public override void Intialize(AIGameManger _aIGameManger) { aIGameManger = _aIGameManger; SetObjInfo(); //player = GameObject.Find("Player"); audioController = Role.GetComponent <AudioController>(); //nav = Role.GetComponent<NavMeshAgent>(); //targetPos = Role.transform.GetChild(2).GetComponent<CapsuleCollider>(); //targetPos.transform.parent = null; //ResetTargetPos(targetPos); ModelPrefab = Role.transform.GetChild(1).gameObject; if (Role.transform.Find("Explosion") != null) { Explosion = Role.transform.Find("Explosion").gameObject; } //m_anim = Role.transform.GetChild(1).GetComponent<Animator>(); m_anim = ModelPrefab.GetComponent <Animator>(); m_anim = null; p_health = Role.GetComponent <PlayerHealth>(); p_health.stateController = this; m_aiState = GroupAIState.IDLE; SetValue(); particileControl = Role.GetComponent <ParticileControl>(); Tower = GameObject.FindObjectOfType <StageChallange>().gameObject; stageChallange = GameObject.FindObjectOfType <StageChallange>(); }
protected override void StateAction() { switch (m_aiState) { case GroupAIState.Null: { m_aiState = GroupAIState.IDLE; } break; case GroupAIState.IDLE: { MotionIdle(); } break; case GroupAIState.ATTACK: { MotionAttack(); } break; case GroupAIState.DEFEND: { } break; case GroupAIState.DEAD: { MotionCollapse(); //MotionDead(); } break; case GroupAIState.COLLAPSE: { MotionCollapse(); MotionDead(); } break; default: break; } }
public void PassInitialize(AIGameManger _aIGameManger) { aIGameManger = _aIGameManger; SetObjInfo(); ModelPrefab = Role.transform.GetChild(1).gameObject; if (Role.transform.Find("Explosion") != null) { Explosion = Role.transform.Find("Explosion").gameObject; } stageChallange = GameObject.FindObjectOfType <StageChallange>(); //audioController = Role.GetComponent<AudioController>(); p_health = Role.GetComponent <PlayerHealth>(); p_health.stateController = this; p_health.currenthp -= 999; m_aiState = GroupAIState.DEAD; //SetValue(); particileControl = Role.GetComponent <ParticileControl>(); MotionCollapse(); }
public virtual void MotionIdle() { currentDesPatchTime += Time.deltaTime; if (CheckEnemy()) { if (currentDesPatchTime > DesPatchTime) { currentDesPatchTime = 0; DesPatch(theTarget); } } if (currentDesPatchTime > DesPatchTime) { currentDesPatchTime = 0; DesPatch(); } if (BeAttack) { m_aiState = GroupAIState.ATTACK; } }
public virtual void MotionAttack() { DefendDesPatch(theTarget); m_aiState = GroupAIState.IDLE; }