예제 #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
    bool UpdateCountdownStanceTimer()
    {
        changeStanceTimer.Countdown();
        float tl = changeStanceTimer.GetCurTimerInSeconds();

        if (tl < 0)
        {
            changeStanceTimer.ResetTimer();
            return(true);
        }
        return(false);
    }
예제 #3
0
    void Wait()
    {
        waitTimer.Countdown();
        float timeLeft = waitTimer.GetCurTimerInSeconds();

        if (timeLeft < 0)
        {
            couldNotReachGoal = false;
            waiting           = false;
            waitTimer.ResetTimer();
            ClearRoute();
        }
    }
예제 #4
0
    // Update is called once per frame
    void Update()
    {
        timeToDie.Countdown();
        float timeLeft = timeToDie.GetCurTimerInSeconds();

        if (timeLeft < 0)
        {
            Destroy(gameObject);
        }

        TurnToPlayer();
        MoveTowardsTarget();
    }
예제 #5
0
    // Update is called once per frame
    void FixedUpdate()
    {
        MarkFoeManage();

        if (attacking == false)
        {
            attTimer.Countdown();
            float timeLeft = attTimer.GetCurTimerInSeconds();
            if (timeLeft < 0)
            {
                Vector3 posNoDecimals = new Vector3(trav.pos.x, trav.pos.y, -1);
                if (transform.position == posNoDecimals)
                {
                    MeasureDistanceToTarget();
                }
            }
        }

        if (attacking == true)
        {
            Attack();
        }
    }