Beispiel #1
0
    private void InitBotBehaviours()
    {
        m_animator = GetComponent <Animator>();

        m_aiSpawnUnit = m_animator.GetBehaviour <AISpawnUnit>();
        m_aiSpawnUnit.SetPlayerEntity(this);

        m_aiBuildObstacles = m_animator.GetBehaviour <AIBuildObstacle>();
        m_aiBuildObstacles.SetPlayerEntity(this);

        m_aiDestroyObstacles = m_animator.GetBehaviour <AIDestroyObstacle>();
        m_aiDestroyObstacles.SetPlayerEntity(this);

        m_aiFindClosestBuild = m_animator.GetBehaviour <AIFindClosestBuild>();

        m_aiRandomActions = m_animator.GetBehaviour <AIRandomActions>();

        m_aiMirrorPlayer = m_animator.GetBehaviour <AIMirrorPlayer>();

        m_aiCreateTeam = m_animator.GetBehaviour <AICreateTeam>();

        m_aiFindCkOnPath = m_animator.GetBehaviour <AIFindCkOnPath>();
        m_aiIdle         = m_animator.GetBehaviour <AIIdle>();

        m_aiStrat = m_animator.GetBehaviour <AIStrat>();
    }
Beispiel #2
0
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        m_aiBuildObstacles   = animator.GetBehaviour <AIBuildObstacle> ();
        m_aiDestroyObstacle  = animator.GetBehaviour <AIDestroyObstacle> ();
        m_aiCreateTeam       = animator.GetBehaviour <AICreateTeam> ();
        m_aiFindCkOnPath     = animator.GetBehaviour <AIFindCkOnPath> ();
        m_aiRandomActions    = animator.GetBehaviour <AIRandomActions> ();
        m_aiGroupOfUnits     = animator.GetBehaviour <AIGroupOfUnits> ();
        m_aiFindClosestBuild = animator.GetBehaviour <AIFindClosestBuild> ();

        animator.SetBool(Constant.BotTransition.s_randomActions, false);
    }