using UnityEngine;
using System.Collections;
public class scrFadeChildren : MonoBehaviour {
// Use this for initialization
static public void show(GameObject go, float time)
{
Transform[] arrChildren = go.GetComponentsInChildren<Transform>();
foreach (Transform child in arrChildren)
{
if (child.gameObject.GetComponent<BoxCollider>() != null)
child.gameObject.GetComponent<BoxCollider>().enabled = true;
TweenAlpha ta = TweenAlpha.Begin(child.gameObject,time,1);
ta.tweenGroup = 99;
ta.eventReceiver = child.gameObject;
ta.unclickableOnFinish = false;
}
}
static public void hide(GameObject go,float time)
{
Transform[] arrChildren = go.GetComponentsInChildren<Transform>();
foreach (Transform child in arrChildren)
{
TweenAlpha ta = TweenAlpha.Begin(child.gameObject,time,0);
ta.tweenGroup = 99;
ta.eventReceiver = child.gameObject;
ta.unclickableOnFinish = true;
}
}
}