コード例 #1
0
 override protected void OnButtonDown(Controller.Command command)
 {
     if (command == Controller.Command.ATTACK)
     {
         if (isAttacking)
         {
             return;
         }
         isAttacking     = true;
         speedMultiplier = 0f;
         float stareTime = attackCharge;
         GetComponentInChildren <SpriteRenderer>().DOColor(Color.blue, stareTime);
         GetComponent <Animator>().enabled = false;
         pounceTimer = TimeControl.StartTimer(stareTime, () => {
             speedMultiplier = attackSpeedMultiplier;
             GetComponent <Attack>().isAttacking = true;
             audio.clip = attackSFX;
             audio.Play();
             pounceTimer = TimeControl.StartTimer(attackTime, () =>
             {
                 speedMultiplier = defaultSpeedMultiplier;
                 GetComponent <Attack>().isAttacking = false;
                 isAttacking = false;
                 GetComponent <Animator>().enabled = true;
                 GetComponentInChildren <SpriteRenderer>().color = Color.white;
             });
         });
     }
 }
コード例 #2
0
    protected override void OnButtonDown(Controller.Command command)
    {
        if (!GameEngine.instance.inGatheringPhase)
        {
            return;
        }
        switch (command)
        {
        case Controller.Command.DASH:
            if (!isDashing)
            {
                StartDash();
            }
            break;

        case Controller.Command.ATTACK:
            if (curInteractTarget != null && curInteractTarget.canInteract && !MapManager.instance.CheckForThreats(transform.position))
            {
                curInteractTarget.StartInteraction(this);
                if (!curInteractTarget.canInteract)
                {
                    curInteractTarget = null;
                    UpdateInteractText();
                }
            }
            else
            {
                StartAttack();
            }
            break;
        }
    }
コード例 #3
0
 protected virtual void OnButtonDown(Controller.Command command)
 {
 }