示例#1
0
        public void PlaBigMoveSkill()
        {
            RemoveFx fx = GetEffectGo(8);

            fx.transform.position = Vector3.zero;
            ShowEffect(fx);
        }
示例#2
0
        public void PlayHeroDie(Vector3 pos)
        {
            RemoveFx fx = GetEffectGo(5);

            fx.transform.position = pos;
            ShowEffect(fx);
        }
示例#3
0
        public void PlayGunFire(Transform tranf)
        {
            RemoveFx fx = GetEffectGo(4);

            fx.transform.parent        = tranf;
            fx.transform.localPosition = Vector3.zero;
            ShowEffect(fx);
        }
示例#4
0
        public void PlayAddDefenseSkill(Transform tranf)
        {
            RemoveFx fx = GetEffectGo(7);

            fx.transform.parent        = tranf;
            fx.transform.localPosition = Vector3.zero;
            ShowEffect(fx);
        }
示例#5
0
        public void BeeMonsterAttack(Transform tranf, bool rotate)
        {
            RemoveFx fx    = GetEffectGo(3);
            Vector3  scale = new Vector3(fx.transform.localScale.x, fx.transform.localScale.y, Mathf.Abs(fx.transform.localScale.z));

            if (!rotate)
            {
                scale.z = -scale.z;
            }

            fx.transform.localScale    = scale;
            fx.transform.parent        = tranf;
            fx.transform.localPosition = Vector3.zero;
            ShowEffect(fx);
        }
示例#6
0
        private RemoveFx GetEffectGo(int id)
        {
            RemoveFx go = null;

            if (EffectDic[id].Count > 0)
            {
                go = EffectDic[id][0];
                EffectDic[id].RemoveAt(0);
            }
            else
            {
                go = InstantiateEffect(fxPrefabList[id]);
                go.Init(id);
            }

            return(go);
        }
示例#7
0
        private void Init()
        {
            EffectDic = new Dictionary <int, List <RemoveFx> >()
            {
            };
            for (int i = 0; i < fxPrefabList.Count; i++)
            {
                if (!EffectDic.ContainsKey(i))
                {
                    EffectDic.Add(i, new List <RemoveFx>());
                }

                for (int j = 0; j < 5; j++)
                {
                    RemoveFx fx = InstantiateEffect(fxPrefabList[i]);
                    fx.Init(i);
                    EffectDic[i].Add(fx);
                }
            }
        }
示例#8
0
 public void Reduction(RemoveFx go, int id)
 {
     go.gameObject.SetActive(false);
     go.transform.parent = transform;
     EffectDic[id].Add(go);
 }
示例#9
0
 private void ShowEffect(RemoveFx fx)
 {
     fx.gameObject.SetActive(true);
     fx.Show();
 }