Example #1
0
        private void ReflectProjectile(AttackInfo info, Vector3 pos, Vector3 dir)
        {
            GameObject obj            = PoolManager.Instance.GetObject(PoolObjectType.AttackInfo);
            AttackInfo reflectionInfo = obj.GetComponent <AttackInfo> ();

            reflectionInfo.Init(null, info.ProjectileSkill, control);
            obj.SetActive(true);
            extraAttackInfo.Add(reflectionInfo);
            //AttackManager.Instance.CurrentAttackInfo.Add(reflectionInfo);
            reflectionInfo.Register();

            /*
             * Vector3 dir = info.Attacker.gameObject.transform.position - control.gameObject.transform.position;
             * dir.y = 0f;
             */
            reflectionInfo.ProjectileSkill.Launch(reflectionInfo, control, pos, dir);
            info.ProjectileObject.Dead();
        }