Exemple #1
0
        // private bool CastAreaBottomSkill(Mage mage, LayerMask IgnorePlayerSpell, LayerMask FloorMask, Vector3 mousePosition, bool isAnimation){
        private bool CastAreaBottomSkill(Mage mage, LayerMask FloorMask, Vector3 mousePosition)
        {
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit floorHit;
            RaycastHit uiHit;

            // if ( isAnimation ){
            //  Vector3 vec = new Vector3(Random.Range(-40,40), 50, 10f+Random.Range(-40,40));
            //  SkillProjectile projectile = AreaBotSkillProjectile.Clone(ElementController.Instance.GetSkillProjectile(mage.Data.GetElement()), mage, vec, new Vector3(vec.x, 0, vec.z),isAnimation);
            //  _animationList.Add(projectile);
            //  return true;
            // }

            // if (!Physics.Raycast(ray, out uiHit, Mathf.Infinity, IgnorePlayerSpell) &&
            //     Physics.Raycast(ray, out floorHit, Mathf.Infinity, FloorMask) &&
            //  !isAnimation)
            if (!Physics.Raycast(ray, out uiHit, Mathf.Infinity, IgnoreSkill) &&
                Physics.Raycast(ray, out floorHit, Mathf.Infinity, FloorMask))
            {
                // SkillProjectile projectile = AreaBotSkillProjectile.Clone(ElementController.Instance.GetSkillProjectile(mage.Data.GetElement()), mage, new Vector3(floorHit.point.x, 0, floorHit.point.z), new Vector3(floorHit.point.x, 0, floorHit.point.z),isAnimation);
                SkillProjectile.Clone <AreaBotSkillProjectile>(GetSkillProjectile(mage.Data.GetElement()), mage,
                                                               new Vector3(floorHit.point.x, 0, floorHit.point.z), null, new Vector3(floorHit.point.x, 0, floorHit.point.z));
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
        // private bool CastAllMinionsSkill(Mage mage, LayerMask IgnorePlayerSpell, LayerMask FloorMask, Vector3 mousePosition, bool isAnimation){
        private bool CastAllMinionsSkill(Mage mage, LayerMask FloorMask, Vector3 mousePosition)
        {
            mage.Player.WaveManager.GetMinionList().ForEach((Minion minion) =>
            {
                // SkillProjectile projectile = AllMinionsSkillProjectile.Clone(ElementController.Instance.GetSkillProjectile(mage.Data.GetElement()), mage, new Vector3(minion.transform.position.x, 50, minion.transform.position.z), minion.gameObject,isAnimation);

                SkillProjectile.Clone <AllMinionsSkillProjectile>(GetSkillProjectile(mage.Data.GetElement()), mage,
                                                                  new Vector3(minion.transform.position.x, 50, minion.transform.position.z), minion.gameObject, new Vector3());
                // if (isAnimation){
                //  _animationList.Add(projectile);
                // }
            });
            return(true);
        }
Exemple #3
0
 // private bool CastAllTowersSkill(Mage mage, LayerMask IgnorePlayerSpell, LayerMask FloorMask, Vector3 mousePosition, bool isAnimation){
 private bool CastAllTowersSkill(Mage mage, LayerMask FloorMask, Vector3 mousePosition)
 {
     mage.Player.Data.GetMages().ToList().ForEach((Mage thisMage) =>
     {
         if (thisMage.GetBuilding() != null && thisMage.GetBuilding() is Tower)
         {
             Tower tower = thisMage.GetBuilding() as Tower;
             // SkillProjectile projectile = AllTowersSkillProjectile.Clone(ElementController.Instance.GetSkillProjectile(mage.Data.GetElement()), mage, new Vector3(tower.gameObject.transform.position.x, 50, tower.gameObject.transform.position.z), tower.gameObject,isAnimation);
             SkillProjectile.Clone <AllTowersSkillProjectile>(GetSkillProjectile(mage.Data.GetElement()), mage,
                                                              new Vector3(tower.gameObject.transform.position.x, 50, tower.gameObject.transform.position.z), tower.gameObject, new Vector3());
             // if (isAnimation){
             //  _animationList.Add(projectile);
             // }
         }
     });
     return(true);
 }