コード例 #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>();
    }
コード例 #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);
    }
コード例 #3
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        m_listSpawnTypeObstacle.Clear();
        m_listSpawnTypeUnit.Clear();
        m_listSpawnTypeUnit.Add(Constant.SpawnTypeUnit.Warrior);
        m_listSpawnTypeUnit.Add(Constant.SpawnTypeUnit.Range);
        m_listSpawnTypeUnit.Add(Constant.SpawnTypeUnit.Tank);
        m_listSpawnTypeUnit.Add(Constant.SpawnTypeUnit.Scout);
        m_listSpawnTypeObstacle.Add(ActiveObstacle.ObstacleType.SimpleWall);
        m_listSpawnTypeObstacle.Add(ActiveObstacle.ObstacleType.Pillar);
        m_listSpawnTypeObstacle.Add(ActiveObstacle.ObstacleType.SlopeRight);
        m_listSpawnTypeObstacle.Add(ActiveObstacle.ObstacleType.SlopeLeft);
        m_listSpawnTypeObstacle.Add(ActiveObstacle.ObstacleType.Trap);

        m_aiBuildObstacle   = animator.GetBehaviour <AIBuildObstacle>();
        m_aiDestroyObstacle = animator.GetBehaviour <AIDestroyObstacle>();
        m_aiSpawnUnit       = animator.GetBehaviour <AISpawnUnit>();
        m_aiReleaseUnits    = animator.GetBehaviour <AIReleaseUnits>();
    }
コード例 #4
0
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     m_aiBuildObstacles  = animator.GetBehaviour <AIBuildObstacle>();
     m_aiDestroyObstacle = animator.GetBehaviour <AIDestroyObstacle>();
 }