Ejemplo n.º 1
0
    public void HeavyAttackUpdate()
    {
        if (isMine && GetComponentInParent <AfterImage>().IsUpdate)
        {
            RaycastHit2D        hit    = Physics2D.Raycast(transform.position, transform.right, 12, LayerMask.GetMask("enemy"));
            RaycastHit2D        hit1   = Physics2D.Raycast(transform.position, transform.right + new Vector3(0, 0.25f, 0), 12, LayerMask.GetMask("enemy"));
            RaycastHit2D        hit2   = Physics2D.Raycast(transform.position, transform.right + new Vector3(0, -0.25f, 0), 12, LayerMask.GetMask("enemy"));
            NetkActorController enemy  = null;
            NetkActorController enemy1 = null;
            NetkActorController enemy2 = null;
            if (hit.collider)
            {
                enemy = hit.collider.GetComponent <NetkActorController>();
            }
            if (hit1.collider)
            {
                enemy1 = hit1.collider.GetComponent <NetkActorController>();
            }
            if (hit2.collider)
            {
                enemy2 = hit2.collider.GetComponent <NetkActorController>();
            }

            if (enemy || enemy1 || enemy2)
            {
                ActorController.Controller.transform.SetPositionY((enemy ? enemy : (enemy1 ? enemy1 : enemy2)).transform.position.y);

                _rigi.velocity = Vector2.zero;
                _anim.SetTrigger("skill2_dash");
            }
        }
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     photonView = GetComponent <PhotonView>();
     controller = GetComponentInChildren <NetkActorController>();
 }