Exemplo n.º 1
0
    public void Attack()
    {
        //animator.SetBool("isAttack", false);

        if (!NetworkServer.active)
        {
            return;
        }

        var collist = Physics.OverlapSphere(transform.position + transform.TransformDirection(new Vector3(0, 0, 0.75f)), 0.5f);

        for (int i = 0; i < collist.Length; i++)
        {
            Barrier      barrier = collist[i].GetComponent <Barrier>();
            PlayerStatus player  = collist[i].GetComponent <PlayerStatus>();
            if (barrier)
            {
                barrier.CmdHit(10);
            }
            if (player)
            {
                player.Hit(gameObject, player.gameObject, 10);
            }
        }
    }