示例#1
0
    public void UpdateState()
    {
        if (!FailSafe())
        {
            return;
        }

        if (enemy.m_waitTime <= enemy.m_chaseFreq && enemy.m_goalWaypoint != null)
        {
            enemy.UpdateJumpingAnimation();
        }
        else
        {
            if (enemy.m_goalWaypoint)
            {
                enemy.m_enemyAnchor.transform.position = enemy.m_goalWaypoint.position;
            }

            // Transition to chase mode when bottom of map is hit
            if (Mathf.Approximately(enemy.m_enemyAnchor.transform.position.y, enemy.m_mapManager.GetLowestWPInMap()))
            {
                ToChaseState();
                return;
            }

            enemy.UpdateGoalWaypoint(GetStrafeWaypoint());

            enemy.m_waitTime      = 0.0f;
            enemy.m_animationTime = 0.0f;
            enemy.m_isJumping     = true;
        }

        enemy.m_waitTime += Time.deltaTime;
    }
    public void UpdateState()
    {
        if (enemy.m_waitTime <= enemy.m_chaseFreq && enemy.m_goalWaypoint != null)
        {
            enemy.UpdateJumpingAnimation();
        }
        else
        {
            if (m_isFirstRun)
            {
                enemy.UpdateGoalWaypoint(PrepEnemy());

                enemy.m_waitTime      = 0.0f;
                enemy.m_animationTime = 0.0f;
                enemy.m_isJumping     = true;

                m_isFirstRun = false;
            }
            else
            {
                ToReachBottomState();
            }
        }

        enemy.m_waitTime += Time.deltaTime;
    }
示例#3
0
    public void UpdateState()
    {
        if (!FailSafe())
        {
            return;
        }

        enemy.m_isBall = false;

        if (enemy.m_waitTime <= enemy.m_chaseFreq && enemy.m_goalWaypoint != null)
        {
            enemy.UpdateJumpingAnimation();
        }
        else
        {
            enemy.UpdateGoalWaypoint(enemy.m_mapManager.GetWaypointInDirectionOfTarget(
                                         enemy.m_currentWaypoint,
                                         enemy.m_chaseTarget.position)
                                     );

            if (enemy.m_goalWaypoint.m_playerWaypointOnly)
            {
                ToExitState();
            }

            enemy.m_waitTime      = 0.0f;
            enemy.m_animationTime = 0.0f;
            enemy.m_isJumping     = true;
        }

        enemy.m_waitTime += Time.deltaTime;
    }