Ejemplo n.º 1
0
    void Attack(Slashing slash)
    {
        int numVictims = Physics2D.LinecastNonAlloc(slash.startPoint, slash.endPoint, slashResults, slashMask);

        for (int i = 0; i < numVictims; i++)
        {
            Enemy_Controller victim = slashResults[i].collider.GetComponent <Enemy_Controller>();

            if (victim.InputUserSlash((slash.endPoint - slash.startPoint).normalized))
            {
                // hit
                UISlashShow.Slash(Vector2.Lerp(slash.endPoint, slash.startPoint, 0.5f), (slash.endPoint - slash.startPoint).normalized);
                if (victim.CompareTag("BasicEnemy"))
                {
                    Player_Controller.instance.Attack(victim);
                }
            }
            else
            {
                if (victim.CompareTag("BasicEnemy"))
                {
                    Player_Controller.instance.Attack(victim);
                }
            }
        }
    }
Ejemplo n.º 2
0
 void Awake()
 {
     instance = this;
 }
Ejemplo n.º 3
0
 void Awake()
 {
     instance = this;
 }