Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }
Example #3
0
 private EffectObjectPool()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     _pool = new List <GameObject>();
 }
    public ObjectInstance(GameObject gameobjectInstance)
    {
        gameObject = gameobjectInstance;
        transform  = gameObject.transform;
        gameObject.SetActive(false);

        if (gameObject.GetComponent <EffectObjectPool>())
        {
            hasPoolObject    = true;
            effectobjectpool = gameObject.GetComponent <EffectObjectPool>();
        }
    }
Example #5
0
        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;
            }
        }
Example #6
0
        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;
                }
            }
        }