IEnumerator WaitEnable(XffectComponent xft) { yield return(new WaitForSeconds(0.05f)); xft.enabled = true; xft.Reset(); }
//useful for only-one effect cache and the effect is looping. public void DeActiveEffect(string eftName) { List <XffectComponent> cache = EffectDic[eftName]; if (cache == null) { Debug.LogError(name + ": cache doesnt exist!"); return; } if (cache.Count > 1) { Debug.LogWarning("DeActive() only support one Xffect cache!"); } XffectComponent xft = cache[0]; if (!XffectComponent.IsActive(xft.gameObject)) { return; } xft.DeActive(); xft.Reset(); XffectComponent.SetActive(xft.gameObject, false); }
//useful for only-one effect cache and the effect is looping. public void DeActiveEffect(string eftName) { ArrayList cache = EffectDic[eftName]; if (cache == null) { Debug.LogError(name + ": cache doesnt exist!"); return; } if (cache.Count > 1) { Debug.LogWarning("DeActive() only support one Xffect cache!"); } XffectComponent xft = (XffectComponent)cache[0]; if (xft.gameObject.active == false) { return; } xft.DeActive(); xft.Reset(); xft.gameObject.active = false; }