Example #1
0
 public void Shoot(float v_h, bool isTopKeyDown, bool isBottomKeyDown)
 {
     shoot = true;
     if (isTopKeyDown == false && isBottomKeyDown == false)
     {
         if (transform.localScale.x == 1)
         {
             shootDir = ShootDir.Left;
         }
         else if (transform.localScale.x == -1)
         {
             shootDir = ShootDir.RIght;
         }
     }
     else
     {
         if (isTopKeyDown)
         {
             shootDir = ShootDir.Top;
         }
         else if (isBottomKeyDown)
         {
             shootDir = ShootDir.Down;
         }
     }
 }
Example #2
0
    public void Shoot(float v_h, bool isTopKeyDown)
    {
        shoot = true;

        //得到射击的方向
        if (isTopKeyDown == false)
        {//不选择射击方向时默认与人物朝向一致
            if (transform.localScale.x == 1)
            {
                shootDir = ShootDir.Left;
            }
            else if (transform.localScale.x == -1)
            {
                shootDir = ShootDir.Right;
            }
        }
        else
        {
            shootDir = ShootDir.Top;
            //else if (isBottomKeyDown)
            //{
            //    shootDir = ShootDir.Down;
            //}
        }
    }
Example #3
0
 public void Shoot(float v_h, bool isTopKeyDown, bool isBottomKeyDown)
 {
     shoot = true;
     //得到射击的方向
     //地面状态射击
     if (isTopKeyDown == false && isBottomKeyDown == false)
     {
         if (playerController.Left)
         {
             shootDir = ShootDir.Left;
         }
         else if (playerController.Right)
         {
             shootDir = ShootDir.Right;
         }
         else if ((playerController.LA && playerController.UpToWalk) || (playerController.RA && playerController.UpToWalk))
         {
             shootDir = ShootDir.Top;
         }
         else
         {
             if (this.transform.localScale.x == 1)
             {
                 shootDir = ShootDir.Left;
             }
             else if (this.transform.localScale.x == -1)
             {
                 shootDir = ShootDir.Right;
             }
         }
     }
     if (isTopKeyDown)
     {
         shootDir = ShootDir.Top;
     }
     if (isBottomKeyDown)
     {
         if (this.transform.localScale.x == 1)
         {
             shootDir = ShootDir.Left;
         }
         else if (this.transform.localScale.x == -1)
         {
             shootDir = ShootDir.Right;
         }
     }
 }
Example #4
0
 public void Shoot(float v_h, bool isTopKeyDown, bool isBottomKeyDown)
 {
     shoot = true;
     //得到射击的方向
     if (isBottomKeyDown)
     {
         if (transform.localScale.x == 1)
         {
             shootDir = ShootDir.Left;
         }
         else if (transform.localScale.x == -1)
         {
             shootDir = ShootDir.Right;
         }
         if (isTopKeyDown)
         {
             shootDir = ShootDir.Top;
         }
     }
     if (isTopKeyDown == false && isBottomKeyDown == false)
     {
         if (playerController.LA || playerController.RA)
         {
             shootDir = ShootDir.Top;
         }
         else if (transform.localScale.x == 1)
         {
             shootDir = ShootDir.Left;
         }
         else if (transform.localScale.x == -1)
         {
             shootDir = ShootDir.Right;
         }
     }
     //else
     //{
     //    if (isTopKeyDown)
     //    {
     //        shootDir = ShootDir.Top;
     //    }
     //    else if (isBottomKeyDown)
     //    {
     //        shootDir = ShootDir.Down;
     //    }
     //}
 }
Example #5
0
 public void Shoot(bool isTopKeyDown, bool isBottomKeyDown)
 {
     shoot = true;
     //Get Shoot Direction
     if (!isTopKeyDown && !isBottomKeyDown)
     {
         shootDir = transform.localScale.x == 1 ? ShootDir.Left : ShootDir.Right;
         print("%%%%%" + shootDir);
     }
     else if (isTopKeyDown)
     {
         shootDir = ShootDir.Top;
     }
     else
     {
         shootDir = ShootDir.Down;
     }
 }
Example #6
0
    public void Shoot(float v_h, bool isTopKeyDown)
    {
        shoot = true;

        //得到射击的方向
        if (isTopKeyDown == false)
        {//不选择射击方向时默认与人物朝向一致
            if (transform.localScale.x == 1)
            {
                shootDir = ShootDir.Left;
            }
            else if (transform.localScale.x == -1)
            {
                shootDir = ShootDir.Right;
            }
        }
        else//同时按下W S 键时按优先级选择射击方向
        {
            shootDir = ShootDir.Top;
        }
    }
Example #7
0
 public void Shoot(float v_h, bool isTopKeyDown, bool isButtomKeyDown)
 {
     shoot = true;
     //得到射击方向
     if (isTopKeyDown == false && isButtomKeyDown == false)
     {
         if (transform.localScale.x == 1)
         {
             shootDir = ShootDir.Left;
         }
         else if (transform.localScale.x == -1)
         {
             shootDir = ShootDir.Right;
         }
     }
     else
     {
         if (isTopKeyDown)
         {
             shootDir = ShootDir.Up;
         }
         else if (isButtomKeyDown)
         {
             shootDir = ShootDir.Down;
         }
     }
 }
Example #8
0
    public void Shoot(float v_h,bool isTopkeyDown, bool isBottomKeyDown)
    {
        shoot = true;

        //得到射击的方向
        if (!isTopkeyDown && !isBottomKeyDown)
        {
            if (transform.localScale.x == 1)
            {
                shootDir = ShootDir.Letf;
            }
            else if (transform.localScale.x == -1)
            {
                shootDir = ShootDir.Right;
            }
        }
        else
        {
            if (isTopkeyDown)
            {
                shootDir = ShootDir.Top;
            }
            else if (isBottomKeyDown)
            {
                shootDir = ShootDir.Down;
            }
        }
    }
Example #9
0
    public void Shoot(float v_h, bool isTopKeyDown, bool isBottomKeyDown)
    {
        shoot = true;
        //得到射击的方向
        //地面状态射击
        if (isTopKeyDown == false && isBottomKeyDown == false) {
            if (playerController.Left)
            {
                shootDir = ShootDir.Left;

            }
            else if (playerController.Right)
            {
                shootDir = ShootDir.Right;
            }
            else if((playerController.LA && playerController.UpToWalk) || (playerController.RA && playerController.UpToWalk)){
                 shootDir = ShootDir.Top;
            }
            else{
                 if (this.transform.localScale.x == 1)
                {
                    shootDir = ShootDir.Left;
                }
                 else if (this.transform.localScale.x == -1)
                {
                    shootDir = ShootDir.Right;
                }
            }
        }
        if (isTopKeyDown)
        {
            shootDir = ShootDir.Top;

        }
        if(isBottomKeyDown){
         if (this.transform.localScale.x == 1)
            {
                shootDir = ShootDir.Left;
            }
            else if (this.transform.localScale.x == -1)
            {
                shootDir = ShootDir.Right;
            }
        }
    }
Example #10
0
 public void Shoot(float v_h, bool isTopKeyDown, bool isBottomKeyDown)
 {
     shoot = true;
     //得到射击的方向
     if (isBottomKeyDown) {
         if (transform.localScale.x == 1)
         {
             shootDir = ShootDir.Left;
         }
         else if (transform.localScale.x == -1)
         {
             shootDir = ShootDir.Right;
         }
         if (isTopKeyDown)
         {
             shootDir = ShootDir.Top;
         }
     }
     if (isTopKeyDown == false && isBottomKeyDown == false)
     {
         if (playerController.LA||playerController.RA) {
             shootDir = ShootDir.Top;
         }
         else if (transform.localScale.x == 1)
         {
             shootDir = ShootDir.Left;
         }
         else if (transform.localScale.x == -1)
         {
             shootDir = ShootDir.Right;
         }
     }
     //else
     //{
     //    if (isTopKeyDown)
     //    {
     //        shootDir = ShootDir.Top;
     //    }
     //    else if (isBottomKeyDown)
     //    {
     //        shootDir = ShootDir.Down;
     //    }
     //}
 }