Beispiel #1
0
        protected BattleEffectHandler PlayEffect(int effectResId, Vector3 postion, float speedRate = 1)
        {
            BattleEffectHandler effect = LoadEffect(effectResId);

            if (effect != null)
            {
                effect.transform.SetParent(transform);
                effect.transform.position      = postion;
                effect.transform.localRotation = Quaternion.identity;
                effect.Play(speedRate);
            }

            return(effect);
        }
Beispiel #2
0
        protected BattleEffectHandler PlayEffect(int effectResId, string bindpoint, float speedRate = 1)
        {
            BattleEffectHandler effect = LoadEffect(effectResId);

            if (effect != null)
            {
                effect.transform.parent        = GetBindPoint(bindpoint);
                effect.transform.localPosition = Vector3.zero;
                effect.transform.localRotation = Quaternion.identity;
                effect.Play(speedRate);
            }

            return(effect);
        }
Beispiel #3
0
        public void PlayAttributeEffect(long id, int effectResId, string bindpoint)
        {
            if (!attributeEffectHandlers.ContainsKey(id))
            {
                BattleEffectHandler effect = PlayEffect(effectResId, bindpoint);

                if (effect != null)
                {
                    attributeEffectHandlers.Add(id, effect);
                }
            }
            else
            {
                attributeEffectHandlers[id].Play();
            }
        }