Beispiel #1
0
 public MeleeSwipe InvertSwipe(MeleeSwipe swipe)
 {
     if (swipe == MeleeSwipe.LeftToRight)
     {
         return(MeleeSwipe.RightToLeft);
     }
     return(MeleeSwipe.LeftToRight);
 }
Beispiel #2
0
    public void DealAttack()
    {
        Vector3 swipeSpawn = transform.position;

        if (mCurrentAttack == 4)          //Evil splode


        {
            Instantiate(evilSplode, swipeSpawn, Quaternion.Euler(new Vector3(0, 0, 0)));
        }
        else if (mCurrentAttack == 5)            //Light spear
        {
            swipeSpawn.y += 1.2f;
            if (isRight)
            {
                swipeSpawn.x += 5.0f;
                Instantiate(lightSpear, swipeSpawn, Quaternion.Euler(new Vector3(0, 0, 0)));
            }
            else
            {
                swipeSpawn.x -= 5.0f;
                Instantiate(lightSpear, swipeSpawn, Quaternion.Euler(new Vector3(0, 0, 180f)));
            }
        }
        else            //Other attacks
        {
            swipeSpawn.y += 1.0f;
            if (isRight)
            {
                swipeSpawn.x += 2.5f;
                MeleeSwipe swipeInstance = Instantiate(melee, swipeSpawn, Quaternion.Euler(new Vector3(0, 0, 0))) as MeleeSwipe;
            }
            else
            {
                swipeSpawn.x -= 2.5f;
                MeleeSwipe swipeInstance = Instantiate(melee, swipeSpawn, Quaternion.Euler(new Vector3(0, 0, 180f))) as MeleeSwipe;
            }
        }
    }