public virtual void DefendIntialize(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; //m_anim = Role.transform.GetChild(1).GetComponent<Animator>(); m_anim = ModelPrefab.GetComponent <Animator>(); p_health = Role.GetComponent <PlayerHealth>(); p_health.stateController = this; p_health.Proprity = proprity; CanEscape = false; SetValue(); Tower = GameObject.FindObjectOfType <StageChallange>().gameObject; particileControl = Role.GetComponent <ParticileControl>(); DropProp = false; RenderGamObjs = ModelPrefab.transform.GetComponentsInChildren <Renderer>(); EventManager.StartListening("DeadEnemy", DeadEnemy); }
public override void Intialize(AIGameManger _aIGameManger) { proprity = GentleProprity; 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; //m_anim = Role.transform.GetChild(1).GetComponent<Animator>(); m_anim = ModelPrefab.GetComponent <Animator>(); p_health = Role.GetComponent <PlayerHealth>(); p_health.stateController = this; p_health.Proprity = proprity; m_aiState = EnemyAIState.IDLE; CanEscape = true; SetValue(); particileControl = Role.GetComponent <ParticileControl>(); DropProp = true; RenderGamObjs = ModelPrefab.transform.GetComponentsInChildren <Renderer>(); //EventManager.StartListening("DeadEnemy", DeadEnemy); }
public override void Intialize(AIGameManger _aIGameManger) { aIGameManger = _aIGameManger; SetObjInfo(); player = GameObject.Find("Player"); audioController = Role.GetComponent <AudioController>(); nav = Role.GetComponent <NavMeshAgent>(); selectable = Role.GetComponent <Selectable>(); if (selectable != null) { selectable.ai = this; } targetPos = Role.transform.GetChild(2).GetComponent <CapsuleCollider>(); targetPos.transform.parent = null; ResetTargetPos(targetPos); ModelPrefab = Role.transform.GetChild(1).gameObject; particileControl = Role.GetComponent <ParticileControl>(); Debug.Log("ModelName" + ModelPrefab.name); m_anim = ModelPrefab.GetComponent <Animator>(); p_health = Role.GetComponent <PlayerHealth>(); p_health.stateController = this; p_health.Proprity = proprity; m_aiState = AIState.IDLE; SetValue(); RenderGamObjs = ModelPrefab.transform.GetComponentsInChildren <Renderer>(); }
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>(); }
public virtual void ChangeModel() { IsGroup = true; GameObject go = Resources.Load <GameObject>(ChangePfbSln); go.name = "CA"; GameObject.Destroy(ModelPrefab.gameObject); ModelPrefab = GameObject.Instantiate(go, Role.transform.position, Role.transform.rotation, Role.transform); m_anim = ModelPrefab.GetComponent <Animator>(); //Snap = ModelPrefab.transform.GetChild(0).gameObject; }
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; initialPosition = ModelPrefab.transform.position; m_anim = ModelPrefab.GetComponent <Animator>(); p_health = Role.GetComponent <PlayerHealth>(); p_health.stateController = this; currentState = MonsterState.STAND; SetValue(); particileControl = Role.GetComponent <ParticileControl>(); //layersChecked = LayerMask.NameToLayer("Combine"); }