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>(); //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 void LoadEnemyData() { Debug.Log("Data - LoadEnemy"); AIGameManger aIGameManger = GameObject.Find("aiGameManger").GetComponent <AIGameManger>(); CreatEnemyModel(aIGameManger); }
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) { //base.Intialize( _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>(); ////m_anim = Role.transform.GetChild(1).GetComponent<Animator>(); //Debug.Log("ModelName" + ModelPrefab.name); //m_anim = ModelPrefab.GetComponent<Animator>(); //p_health = Role.GetComponent<PlayerHealth>(); //p_health.stateController = this; ////m_aiState = AIState.IDLE; ////layersChecked = LayerMask.NameToLayer("Enemy"); //SetValue(); }
public override void Intialize(AIGameManger _aIGameManger) { base.Intialize(_aIGameManger); ChangePfbSln = "Enemy/" + "CA"; m_objInfo.Type = "Enemy"; SetValue(); Snap = ModelPrefab.transform.GetChild(0).gameObject; PfbTypeName = "CB"; }
public override void Intialize(AIGameManger _aIGameManger) { proprity = HeavyProprity; base.Intialize(_aIGameManger); m_objInfo.Type = "Soilder"; m_objInfo.FollowerTypeID = 4; SetValue(); Audio = Role.GetComponent <AudioSource>(); }
public override void Intialize(AIGameManger _aIGameManger) { base.Intialize(_aIGameManger); m_objInfo.Type = "Soilder"; m_objInfo.FollowerTypeID = 2; PfbTypeName = "S2"; m_BombState = bombState.Null; //camFreeLook = GameObject.FindObjectOfType<CinemachineStateDrivenCamera>().GetComponentInChildren<CinemachineFreeLook>(); cameraShake = GameObject.FindObjectOfType <CameraShake>(); }
/// <summary> /// LittleSoilder_S0 /// </summary> /// <param name="_aIGameManger"></param> //protected override void FixUpdateAI() //{ // InputProcess(); // StateAction(); //} //AudioSource Audio; public override void Intialize(AIGameManger _aIGameManger) { proprity = GentleProprity; base.Intialize(_aIGameManger); m_objInfo.Type = "Soilder"; m_objInfo.FollowerTypeID = 0; SetValue(); //Audio = Role.GetComponent<AudioSource>(); audioController = Role.GetComponent <AudioController>(); //audioController.PlaySound(0,1); }
public override void DefendIntialize(AIGameManger _aIGameManger) { base.DefendIntialize(_aIGameManger); ChangePfbSln = "Enemy/" + "CA"; m_objInfo.Type = "Enemy"; SetValue(); Snap = ModelPrefab.transform.GetChild(0).gameObject; CanEscape = false; PfbTypeName = "CB"; //RenderGamObjs = ModelPrefab.transform.GetComponentsInChildren<Renderer>(); }
public override void Intialize(AIGameManger _aIGameManger) { neighbors = new List <GameObject>(); base.Intialize(_aIGameManger); m_objInfo.Type = "Soilder"; m_objInfo.FollowerTypeID = 1; wanderTime = Random.Range(1, 2); WaitTime = Random.Range(5, 10); pos = Role.transform.position; PfbTypeName = "S1"; m_SummonState = SummonState.Null; }
public override void DefendIntialize(AIGameManger _aIGameManger) { base.DefendIntialize(_aIGameManger); //EventManager.StartListening("DeadEnemy", DeadEnemy); m_objInfo.Type = "Enemy"; SetValue(); CanEscape = false; sneak = true; aIGameManger.StartCoroutineEvent(DigOutGround(.5f)); //RenderGamObj = ModelPrefab.transform.GetChild(5).gameObject; PfbTypeName = "NS"; }
public override void Intialize(AIGameManger _aIGameManger) { base.Intialize(_aIGameManger); m_objInfo.Type = "Enemy"; SetValue(); m_anim.SetBool("Disguise", true); DigInGround(); //RenderGamObj = ModelPrefab.transform.GetChild(5).gameObject; //m_Delegrate += MotionSneak; PfbTypeName = "NS"; //AttackTutorial = Role.transform.Find("AttackTutorialCanvas").gameObject; }
public void Initialized(AIGameManger _aIGameManger, LoadAndSave data) { IsPass = false; //Door = GameObject.FindGameObjectWithTag("StageDoor"); aIGameManger = _aIGameManger; Door = Instantiate(Resources.Load <GameObject>("Door"), StageDoorPos.position, Quaternion.identity); Door.GetComponent <DoorInfo>().NextStage = aIGameManger.StageNum + 1; Door.SetActive(false); stageData = data; particileControl = GetComponent <ParticileControl>(); }
public override void Intialize(AIGameManger _aIGameManger) { SetValue(); base.Intialize(_aIGameManger); m_objInfo.Type = "Soilder"; m_objInfo.FollowerTypeID = 2; StopDistance = 10; AttackTime = 1.5f; hight = 3; wanderTime = Random.Range(1, 2); WaitTime = Random.Range(5, 10); }
private void CreatSoilderModel(AIGameManger _aIGameManger) { for (int i = 0; i < m_datainfolist.dataList.Count; i++) { SoilderAIStateController ai; Quaternion spawnRotation = new Quaternion(); spawnRotation.eulerAngles = new Vector3(0.0f, Random.Range(0.0f, 360.0f)); switch (m_datainfolist.dataList[i].name) { case ("S0"): ai = new LittleMaoStateController(); _aIGameManger.CreatSoilderRole(ai, "Props/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation); ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp; break; case ("S1"): ai = new SummonMaoStateController(); _aIGameManger.CreatSoilderRole(ai, "Props/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation); ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp; break; case ("S2"): ai = new BombMaoStateController(); _aIGameManger.CreatSoilderRole(ai, "Props/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation); ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp; break; case ("S3"): ai = new HeadMaoStateController(); _aIGameManger.CreatSoilderRole(ai, "Props/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation); ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp; break; case ("S4"): ai = new BattleMaoStateController(); _aIGameManger.CreatSoilderRole(ai, "Props/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation); ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp; break; default: break; } } }
private void Awake() { particileControl = GetComponent <ParticileControl>(); //m_anim = transform.GetChild(0).GetComponent<Animator>(); m_anim = GetComponent <Animator>(); bc = GameObject.FindObjectOfType <BoxBackageUIControl>(); aIGameManger = GameObject.FindObjectOfType <AIGameManger>(); treeManger = GameObject.FindObjectOfType <TreeManger>(); GameObject.FindObjectOfType <CinemachineStateDrivenCamera>().Follow = this.transform; GameObject.FindObjectOfType <CinemachineStateDrivenCamera>().LookAt = this.transform.GetChild(0).transform; GameObject.FindObjectOfType <CinemachineStateDrivenCamera>().m_AnimatedTarget = m_anim; audioController = GetComponent <AudioController>(); updateFollow = gun.GetComponent <FixedUpdateFollow>(); }
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 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"); }
public void PassInitialized(AIGameManger _aIGameManger, LoadAndSave data) { IsPass = true; //BoxBackageUIControl.Instance.SuccessState(); aIGameManger = _aIGameManger; Door = Instantiate(Resources.Load <GameObject>("Door"), StageDoorPos.position, Quaternion.identity); Door.GetComponent <DoorInfo>().NextStage = aIGameManger.StageNum + 1; Vector3 ChallangePos = this.transform.position; Syringe = GameObject.Instantiate(Resources.Load <GameObject>("Syringe"), ChallangePos, Quaternion.identity); medicine = Syringe.transform.GetChild(3).gameObject; medicine.transform.localScale = new Vector3(1, .1f, 1); //Syringe.SetActive(true); stageData = data; particileControl = GetComponent <ParticileControl>(); if (PlaceObj != null) { PlaceObj.SetActive(true); } //StartCoroutine(PassSpawner()); }
public override void Intialize(AIGameManger _aIGameManger) { proprity = MediumProprity; //ShootPos = ShootObj[0].transform; for (int i = 0; i < 3; i++) { ShootObj[i] = Role.transform.GetChild(3).transform.GetChild(i).gameObject; Debug.Log(Role.transform.GetChild(3).transform.GetChild(i).name); } base.Intialize(_aIGameManger); m_objInfo.Type = "Soilder"; m_objInfo.FollowerTypeID = 3; SetValue(); //spring x = 0.0f; v = 0.0f; xt = 0.0f; mx = Role.transform.position.x; my = Role.transform.position.z; Audio = Role.GetComponent <AudioSource>(); }
private void CreatEnemyModel(AIGameManger _aIGameManger) { Debug.Log("data - createnemy"); for (int i = 0; i < m_datainfolist.monsterdataList.Count; i++) { EnemyAIStateController ai; CombineEnemyAIStateController combine_ai; Quaternion spawnRotation = new Quaternion(); spawnRotation.eulerAngles = new Vector3(0.0f, Random.Range(0.0f, 360.0f)); switch (m_datainfolist.monsterdataList[i].Type) { case ("NS"): ai = new LittleMonsterStateController(); _aIGameManger.CreatEnemyRole(ai, "Enemy/" + m_datainfolist.monsterdataList[i].Type, m_datainfolist.monsterdataList[i].LastPos, spawnRotation); ai.p_health.currenthp = m_datainfolist.monsterdataList[i].currentHp; break; case ("CB"): combine_ai = new CombineMonsterStateController(); _aIGameManger.CreatCombineEnemyRole(combine_ai, "Enemy/" + m_datainfolist.monsterdataList[i].Type, m_datainfolist.monsterdataList[i].LastPos, spawnRotation); combine_ai.p_health.currenthp = m_datainfolist.monsterdataList[i].currentHp; if (m_datainfolist.monsterdataList[i].currentHp > 30) { combine_ai.ChangeModel(); } break; case ("CA"): combine_ai = new CombineMonsterStateController(); _aIGameManger.CreatCombineEnemyRole(combine_ai, "Enemy/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation); combine_ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp; break; default: break; } } }
public void LoadSoilderData() { AIGameManger aIGameManger = GameObject.Find("aiGameManger").GetComponent <AIGameManger>(); CreatSoilderModel(aIGameManger); }
//初始化 public abstract void Intialize(AIGameManger _aIGameManger);
public override void Intialize(AIGameManger _aIGameManger) { base.Intialize(_aIGameManger); }
// Use this for initialization public void Initinal(int stageNum, LoadAndSave _PlayerData, StageChallange stageChallange, AIGameManger _aIGameManger) { ////aIStateController = new AIStateController(); //m_Controller = new AvaterController(); ////m_Controller = new CharacterControlMove(); ////m_Controller.Player = GameObject.Find("Player"); //m_Controller.Player =GameObject.Instantiate( Resources.Load<GameObject>("Player"), _PlayerData.m_datainfolist.playerdata.LastPos,Quaternion.identity); //m_Controller.Player.name = "Player"; //m_Controller.Initialized(); //m_Controller.Player.GetComponent<NewPlayerController>().maogame = this; //m_Controller.Player.GetComponent<NewPlayerController>()._data = _PlayerData; //TurnStage = false; //GameObject.FindObjectOfType<CameraFollow>().Player = m_Controller.Player; //if(!_PlayerData.m_datainfolist.stageData.Pass) //{ // //creat door or sendmessange to scene obj // GameObject.FindObjectOfType<StageChallange>().Initialized(_aIGameManger,_PlayerData); //} //else //{ // // // GameObject.FindObjectOfType<StageChallange>().PassInitialized(_aIGameManger,_PlayerData); //} //if(GameObject.FindObjectOfType<teach>() != null) //{ // GameObject.FindObjectOfType<teach>().Player = m_Controller.Player; //} ////------ //TreeManger treeManger = GameObject.FindObjectOfType<TreeManger>(); //treeManger.Initialized(_PlayerData,m_Controller.Player.transform); //if(GameObject.FindObjectOfType<NewMiniMap>()!=null) //{ // NewMiniMap minimap = GameObject.FindObjectOfType<NewMiniMap>(); // minimap.InitializedMapRange(m_Controller.Player); //} //aIStateController = new AIStateController(); //Player = GameObject.Instantiate(Resources.Load<GameObject>("Player"), _PlayerData.m_datainfolist.playerdata.LastPos, Quaternion.identity); Player = GameObject.FindGameObjectWithTag("Player"); Player.name = "Player"; Player.GetComponent <NewPlayerController>().maogame = this; Player.GetComponent <NewPlayerController>()._data = _PlayerData; TurnStage = false; GameObject.FindObjectOfType <CameraFollow>().Player = Player; if (!_PlayerData.m_datainfolist.stageData.Pass) { //creat door or sendmessange to scene obj GameObject.FindObjectOfType <StageChallange>().Initialized(_aIGameManger, _PlayerData); } else { // GameObject.FindObjectOfType <StageChallange>().PassInitialized(_aIGameManger, _PlayerData); Player.transform.position = _PlayerData.m_datainfolist.playerdata.LastPos; } if (GameObject.FindObjectOfType <teach>() != null) { GameObject.FindObjectOfType <teach>().Player = Player; } //------ TreeManger treeManger = GameObject.FindObjectOfType <TreeManger>(); treeManger.Initialized(_PlayerData, Player.transform); if (GameObject.FindObjectOfType <NewMiniMap>() != null) { NewMiniMap minimap = GameObject.FindObjectOfType <NewMiniMap>(); minimap.InitializedMapRange(Player); } }