コード例 #1
0
ファイル: HeAttac.cs プロジェクト: yetyman/2d-GameAttempt
    // Start is called before the first frame update
    void Awake()
    {
        audio          = GetComponent <AudioSource>();
        _heParticipate = GetComponent <HeParticipate>();

        if (IsPlayer)
        {
            inputAction = asset.FindAction("Player/Fire");
            // Getting the first binding of the input action using index of 0. If we had more bindings, we would use different indices.
            buttonControl = (ButtonControl)inputAction.controls[0];
            inputAction.Enable();

            if (_heParticipate != null)
            {
                _heParticipate.TeamName = Teams.Player.ToString();
            }
            //InputController.RightMouseClick.AddListener(a => StartCoroutine(Attac()) );
        }
        else
        {
            TriggerAttack(new InputAction.CallbackContext());
        }
    }
コード例 #2
0
ファイル: HeAttac.cs プロジェクト: yetyman/2d-GameAttempt
 public virtual void Damage(HeParticipate participant)
 {
     Debug.Log($"{participant.name} was damaged by {name}!!");
 }