public void EnableEliteBornColor(float r, float g, float b, float power) { if (_DeathEffect != null /*|| _FadeEffect != null*/) { return; } var type = RimEffectType.EliteBornColor; EntityRimEffect effect; if (!_EntityRimEffectMap.TryGetValue(type, out effect)) { effect = EffectObjectPool.Get(this, EffectType.EliteBornColor) as EntityRimEffect; _EntityRimEffectMap.Add(type, effect); } if (effect == null) { effect = EffectObjectPool.Get(this, EffectType.EliteBornColor) as EntityRimEffect; _EntityRimEffectMap[type] = effect; } var eliteBornColor = effect as EliteBornColor; if (eliteBornColor != null) { _CurEffectsMask |= eliteBornColor.Mask; eliteBornColor.Start(r, g, b, power); } }
public void StartTwinkleWhite(float duration, float r, float g, float b, float a, float power) { if (_DeathEffect != null /*|| _FadeEffect != null*/) { return; } var type = RimEffectType.TwinkleWhite; EntityRimEffect effect; if (!_EntityRimEffectMap.TryGetValue(type, out effect)) { effect = EffectObjectPool.Get(this, EffectType.HitTwinkleWhite) as EntityRimEffect; _EntityRimEffectMap.Add(type, effect); } if (effect == null) { effect = EffectObjectPool.Get(this, EffectType.HitTwinkleWhite) as EntityRimEffect; _EntityRimEffectMap[type] = effect; } var hitTwinkleWhite = effect as HitTwinkleWhite; if (hitTwinkleWhite != null) { _CurEffectsMask |= hitTwinkleWhite.Mask; hitTwinkleWhite.Start(duration, r, g, b, a, power); } }
public void DissoveToDeath(float r, float g, float b, float a, float corpseStayDuration) { if (_DeathEffect != null) { return; } _DeathEffect = EffectObjectPool.Get(this, EffectType.DissolveDeath) as DissoveDeath; if (_DeathEffect != null) { _DeathEffect.Start(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f, corpseStayDuration); _CurEffectsMask |= _DeathEffect.Mask; } }
public void EnableFrozenEffect(bool enable) { if (_DeathEffect != null) { return; } if (enable) { if (null == _Frozen) { _Frozen = EffectObjectPool.Get(this, EffectType.Frozen) as Frozen; } if (_Frozen != null) { _Frozen.Start(() => { if (_Frozen != null) { _CurEffectsMask |= _Frozen.Mask; } }); } } else { if (_Frozen != null) { _Frozen.Stop(); _CurEffectsMask &= ~_Frozen.Mask; _Frozen = null; } } var animations = GetComponentsInChildren <Animation>(); foreach (var v in animations) { if (null != v && v.enabled == enable) { v.enabled = !enable; } } }