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>(); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { m_aiBuildObstacles = animator.GetBehaviour <AIBuildObstacle>(); m_isCollider = false; //m_listObstacleConstructors[12].BuildObstacle(Constant.SpawnType.SimpleWall); m_ind = 0; m_newPath = new NavMeshPath(); //get area collider foreach (CheckpointCollider ck in m_checkpoints) { if (ck.GetColliderType() == CheckpointCollider.ECollider.areaCollider) { m_ckAreaCollider = ck.GetComponent <BoxCollider>(); } } m_virtualArea = new GameObject(); m_colliderOnAreaCollider = m_virtualArea.AddComponent <BoxCollider>(); m_colliderOnAreaCollider.transform.position = m_ckAreaCollider.transform.position; m_colliderOnAreaCollider.size = m_ckAreaCollider.gameObject.transform.localScale + m_ckAreaCollider.size; m_colliderOnAreaCollider.size += new Vector3(0f, 50f, 0f); m_colliderOnAreaCollider.isTrigger = true; }
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); }
// 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>(); }
// 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>(); }