Esempio n. 1
0
 public void Init()
 {
     foreach (Transform child in transform)
     {
         XffectComponent xft = child.GetComponent <XffectComponent>();
         if (xft != null)
         {
             //make sure all children is inited.
             xft.Initialize();
             if (!EffectDic.ContainsKey(child.name))
             {
                 EffectDic[child.name] = new List <XffectComponent>();
             }
             EffectDic[child.name].Add(xft);
         }
         CompositeXffect cxft = child.GetComponent <CompositeXffect>();
         if (cxft != null)
         {
             cxft.Initialize();
             if (!CompEffectDic.ContainsKey(child.name))
             {
                 CompEffectDic[child.name] = new List <CompositeXffect>();
             }
             CompEffectDic[child.name].Add(cxft);
         }
     }
     mInited = true;
 }
 void Awake()
 {
     m_instance = this;
     foreach (Transform child in transform)
     {
         XffectComponent xft = child.GetComponent <XffectComponent>();
         if (xft != null)
         {
             //make sure all children is inited.
             xft.Initialize();
             if (!EffectDic.ContainsKey(child.name))
             {
                 EffectDic[child.name] = new ArrayList();
             }
             EffectDic[child.name].Add(xft);
         }
         CompositeXffect cxft = child.GetComponent <CompositeXffect>();
         if (cxft != null)
         {
             cxft.Initialize();
             if (!CompEffectDic.ContainsKey(child.name))
             {
                 CompEffectDic[child.name] = new ArrayList();
             }
             CompEffectDic[child.name].Add(cxft);
         }
     }
 }
Esempio n. 3
0
 //pre-init xffect objs to avoid lags when they get activated.
 void Start()
 {
     explode_energy.Initialize();
     ice_impact.Initialize();
     suckblood.Initialize();
     firestorm.Initialize();
     phantomsword.Initialize();
     cyclonestorm.Initialize();
     radial_energy.Initialize();
     lightning_storm.Initialize();
     glow_per_obj.Initialize();
 }