コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (attacking)
        {
            attTimer.Countdown();
            float timeLeft = attTimer.GetCurTimerInSeconds();

            if (timeLeft < 0)
            {
                attTimer.ResetTimer();

                PlayerInfo target = Target.GetTargetUnit();
                if (!fromButton)
                {
                    GetTarget();
                }

                if (fromButton)
                {
                    fromButton = false;
                    GetTargetFromAttackButton();
                }
            }
        }
    }
コード例 #2
0
 void Attack()
 {
     gi.dmg = pinfo.stats.GetRandomDamage();
     gi.SetDmgTextColor(2);
     Instantiate(spear, transform.position, Quaternion.identity);
     attTimer.ResetTimer();
     attacking = false;
 }
コード例 #3
0
ファイル: Ability.cs プロジェクト: Erre96/Survival-Game
 public override void StartCooldown()
 {
     duration.ResetTimer();
     duration.SetActivity(true);
     coolDown.SetActivity(true);
     //Debug.Log("Duration"+abc.abilityDuration.Length+"cooldown"+abc.abilityCooldown.Length);
     abc.SetAbilityCooldown(slot, coolDown);
     abc.SetAbilityDuration(slot, duration);
 }
コード例 #4
0
    public void AnimateSprite(bool state)
    {
        animate = state;

        if (animate == true)
        {
            changeStanceTimer.ResetTimer();
            Move();
        }

        if (animate == false)
        {
            bool allowed = UpdateCountdownStanceTimer();
            if (allowed)
            {
                StayIdle();
            }
        }
    }
コード例 #5
0
    void Wait()
    {
        waitTimer.Countdown();
        float timeLeft = waitTimer.GetCurTimerInSeconds();

        if (timeLeft < 0)
        {
            couldNotReachGoal = false;
            waiting           = false;
            waitTimer.ResetTimer();
            ClearRoute();
        }
    }