コード例 #1
0
ファイル: PlayerDie.cs プロジェクト: IquWire/WeAR-Test-
 public virtual void Die()
 {
     if (PlayerDieEvent != null)
     {
         PlayerDieEvent.Invoke();
     }
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: xzxzxc/Bomblueghue
 public override void Kill()
 {
     if (Killed)
     {
         return;
     }
     Killed = true;
     PlayerDieEvent?.Invoke();
     Life--;
     base.Kill();
 }
コード例 #3
0
    private void Update()
    {
        Vector2 moveInput = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));

        if (joystick.Horizontal != 0 || joystick.Vertical != 0)
        {
            moveInput = new Vector2(joystick.Horizontal, joystick.Vertical);
        }
        moveVelocity = moveInput.normalized * speed;

        if (health <= 0)
        {
            PlayerDieEvent.Invoke();
        }
    }