public void disableForDebug() { PlayMakerFSM[] components = base.GetComponents <PlayMakerFSM>(); foreach (PlayMakerFSM playMakerFSM in components) { playMakerFSM.enabled = false; Debug.Log(playMakerFSM.FsmName + " was disabled"); } PlayMakerArrayListProxy[] components2 = base.GetComponents <PlayMakerArrayListProxy>(); foreach (PlayMakerArrayListProxy playMakerArrayListProxy in components2) { playMakerArrayListProxy.enabled = false; } base.GetComponent <mutantAI>().enabled = false; mutantAnimatorControl component = base.GetComponent <mutantAnimatorControl>(); if (component) { component.enabled = false; } creepyAnimatorControl component2 = base.GetComponent <creepyAnimatorControl>(); if (component2) { component2.enabled = false; } mutantBabyAnimatorControl component3 = base.GetComponent <mutantBabyAnimatorControl>(); if (component3) { component3.enabled = false; } }
private void Start() { this.setup = base.transform.root.GetComponentInChildren <mutantScriptSetup>(); this.animControl = base.transform.root.GetComponentInChildren <mutantAnimatorControl>(); this.animator = this.animControl.transform.GetComponent <Animator>(); this.rootTr = base.transform.root; this.treeBool = this.setup.pmCombat.FsmVariables.GetFsmBool("inTreeBool"); base.Invoke("setStartUp", 1f); }
private void Start() { this.animControl = base.transform.GetComponent <mutantAnimatorControl>(); this.baseTr = base.transform; this.ankleToGroundOffset = this.leftFootTarget.position.y - this.baseTr.position.y; }
private void doAwake() { if (this.disableAiForDebug) { this.disableForDebug(); } this.allFSM = base.gameObject.GetComponents<PlayMakerFSM>(); PlayMakerFSM[] array = this.allFSM; for (int i = 0; i < array.Length; i++) { PlayMakerFSM playMakerFSM = array[i]; if (playMakerFSM.FsmName == "action_combatFSM") { this.pmCombat = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "action_inTreeFSM") { this.pmTree = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "global_visionFSM") { this.pmVision = playMakerFSM; } if (playMakerFSM.FsmName == "action_searchFSM") { this.pmSearch = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "action_stalkingFSM") { this.pmStalk = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "global_motorFSM") { this.pmMotor = playMakerFSM; } if (playMakerFSM.FsmName == "action_sleepingFSM") { this.pmSleep = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "global_brainFSM") { this.pmBrain = playMakerFSM; } if (playMakerFSM.FsmName == "global_alertManagerFSM") { this.pmAlert = playMakerFSM; } if (playMakerFSM.FsmName == "action_encounterFSM") { this.pmEncounter = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "global_targetManagerFSM") { this.pmTargetManager = playMakerFSM; } } this.thisGo = base.gameObject; this.rootTr = base.transform.root.transform; this.rotateTr = base.transform; this.familyFunctions = base.transform.parent.GetComponent<mutantFamilyFunctions>(); this.animator = base.GetComponent<Animator>(); this.ai = base.GetComponent<mutantAI>(); this.aiManager = base.GetComponent<mutantAiManager>(); this.typeSetup = base.transform.parent.GetComponent<mutantTypeSetup>(); this.health = base.GetComponent<EnemyHealth>(); this.dayCycle = base.GetComponentInChildren<mutantDayCycle>(); this.enemyEvents = base.transform.GetComponent<enemyAnimEvents>(); this.controller = base.transform.root.GetComponent<CharacterController>(); this.hashs = base.transform.GetComponent<mutantMaleHashId>(); this.propManager = base.transform.GetComponent<mutantPropManager>(); this.bodyVariation = base.transform.GetComponentInChildren<setupBodyVariation>(); this.collisionDetect = base.transform.GetComponentInChildren<mutantCollisionDetect>(); this.hitReceiver = base.transform.GetComponentInChildren<mutantHitReceiver>(); this.animControl = base.transform.GetComponentInChildren<mutantAnimatorControl>(); if (!this.disableAiForDebug) { this.sceneInfo = Scene.SceneTracker; } this.search = base.GetComponent<mutantSearchFunctions>(); this.worldSearch = base.transform.parent.GetComponent<mutantWorldSearchFunctions>(); this.mutantStats = base.transform.parent.GetComponent<targetStats>(); Transform[] componentsInChildren = base.transform.parent.GetComponentsInChildren<Transform>(); Transform[] array2 = componentsInChildren; for (int j = 0; j < array2.Length; j++) { Transform transform = array2[j]; if (transform.name == "char_Head") { this.headJoint = transform.gameObject; } if (transform.name == "char_LeftHandWeapon") { this.charLeftWeaponGo = transform.gameObject; } if (transform.name == "currentWaypoint") { this.currentWaypoint = transform.gameObject; } if (transform.name == "lastPlayerSighting") { this.lastSighting = transform.gameObject; } if (transform.name == "tempLookat") { this.lookatTr = transform; } if (transform.name == "char_club_mesh1") { this.weapon = transform.gameObject; } if (transform.name == "FireStick") { this.fireWeapon = transform.gameObject; } if (transform.name == "char_RightHand") { this.clawsWeapon = transform.gameObject; } if (transform.name == "weaponLeftGO") { this.leftWeapon = transform.gameObject; } if (transform.name == "weaponLeftGO1") { this.leftWeapon1 = transform.gameObject; } if (transform.name == "weaponRightGO") { this.rightWeapon = transform.gameObject; } if (transform.name == "mainHitTrigger") { this.mainWeapon = transform.gameObject; } if (transform.name == "fireBomb") { this.fireBombGo = transform.gameObject; } if (transform.name == "dragPointGo") { this.familyFunctions.dragPoint = transform.gameObject; } if (transform.name == "bodyCollision") { if (this.pmCombat) { this.pmCombat.FsmVariables.GetFsmGameObject("bodyCollisionGo").Value = transform.gameObject; } this.bodyCollisionCollider = transform.GetComponent<CapsuleCollider>(); } if (transform.name == "char_LeftFoot") { this.leftFoot = transform; } if (transform.name == "headCollision") { this.headColliderGo = transform.gameObject; } } }
private IEnumerator spawnRegularMale() { int count = 0; bool doName = false; while (count < this.amount_male) { Vector2 vector = this.Circle2(UnityEngine.Random.Range(2f, this.range)); Vector3 vector2 = new Vector3(vector.x + base.transform.position.x, base.transform.position.y, vector.y + base.transform.position.z); this.clone = PoolManager.Pools["enemies"].Spawn(this.mutant.transform, vector2, Quaternion.identity); if (!doName) { this.clone.gameObject.name = this.clone.gameObject.name + this.nameCount; doName = true; this.nameCount++; } base.StartCoroutine(this.fixMutantPosition(this.clone, vector2)); this.clone.GetChild(0).eulerAngles = new Vector3(0f, (float)UnityEngine.Random.Range(0, 360), 0f); this.clone.SendMessage("setInstantSpawn", this.instantSpawn); if (this.leader && this.doLeader) { this.leaderGo = this.clone.gameObject; this.leaderGo.SendMessage("setLeader", this.paintedTribe); this.leaderGo.SendMessage("setInCave", this.spawnInCave); if (this.sinkholeSpawn) { this.leaderGo.SendMessage("setInCave", true); } this.leaderGo.SendMessage("addToSpawn", base.gameObject); this.leaderGo.SendMessage("eatingOnSpawn", this.eatingOnSpawn); this.doLeader = false; } else { if (this.leaderGo) { this.clone.SendMessage("setFollower", this.leaderGo); } this.clone.SendMessage("setInCave", this.spawnInCave); if (this.sinkholeSpawn) { this.clone.SendMessage("setInCave", true); } this.clone.SendMessage("setDefault", this.paintedTribe); this.clone.SendMessage("addToSpawn", base.gameObject); this.clone.SendMessage("eatingOnSpawn", this.eatingOnSpawn); } if (this.debugMovement) { mutantAnimatorControl componentInChildren = this.clone.GetComponentInChildren <mutantAnimatorControl>(); if (componentInChildren) { componentInChildren.stopMovement = true; } } count++; } yield return(null); yield break; }
private void doAwake() { if (this.disableAiForDebug) { this.disableForDebug(); } this.allFSM = base.gameObject.GetComponents <PlayMakerFSM>(); PlayMakerFSM[] array = this.allFSM; for (int i = 0; i < array.Length; i++) { PlayMakerFSM playMakerFSM = array[i]; if (playMakerFSM.FsmName == "action_combatFSM") { this.pmCombat = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "action_inTreeFSM") { this.pmTree = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "global_visionFSM") { this.pmVision = playMakerFSM; } if (playMakerFSM.FsmName == "action_searchFSM") { this.pmSearch = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "action_stalkingFSM") { this.pmStalk = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "global_motorFSM") { this.pmMotor = playMakerFSM; } if (playMakerFSM.FsmName == "action_sleepingFSM") { this.pmSleep = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "global_brainFSM") { this.pmBrain = playMakerFSM; } if (playMakerFSM.FsmName == "global_alertManagerFSM") { this.pmAlert = playMakerFSM; } if (playMakerFSM.FsmName == "action_encounterFSM") { this.pmEncounter = playMakerFSM; this.actionFSM.Add(playMakerFSM); } if (playMakerFSM.FsmName == "global_targetManagerFSM") { this.pmTargetManager = playMakerFSM; } } this.thisGo = base.gameObject; this.rootTr = base.transform.root.transform; this.rotateTr = base.transform; this.familyFunctions = base.transform.parent.GetComponent <mutantFamilyFunctions>(); this.animator = base.GetComponent <Animator>(); this.ai = base.GetComponent <mutantAI>(); this.aiManager = base.GetComponent <mutantAiManager>(); this.typeSetup = base.transform.parent.GetComponent <mutantTypeSetup>(); this.health = base.GetComponent <EnemyHealth>(); this.dayCycle = base.GetComponentInChildren <mutantDayCycle>(); this.enemyEvents = base.transform.GetComponent <enemyAnimEvents>(); this.controller = base.transform.root.GetComponent <CharacterController>(); this.hashs = base.transform.GetComponent <mutantMaleHashId>(); this.propManager = base.transform.GetComponent <mutantPropManager>(); this.bodyVariation = base.transform.GetComponentInChildren <setupBodyVariation>(); this.collisionDetect = base.transform.GetComponentInChildren <mutantCollisionDetect>(); this.hitReceiver = base.transform.GetComponentInChildren <mutantHitReceiver>(); this.animControl = base.transform.GetComponentInChildren <mutantAnimatorControl>(); if (!this.disableAiForDebug) { this.sceneInfo = Scene.SceneTracker; } this.search = base.GetComponent <mutantSearchFunctions>(); this.worldSearch = base.transform.parent.GetComponent <mutantWorldSearchFunctions>(); this.mutantStats = base.transform.parent.GetComponent <targetStats>(); Transform[] componentsInChildren = base.transform.parent.GetComponentsInChildren <Transform>(); Transform[] array2 = componentsInChildren; for (int j = 0; j < array2.Length; j++) { Transform transform = array2[j]; if (transform.name == "char_Head") { this.headJoint = transform.gameObject; } if (transform.name == "char_LeftHandWeapon") { this.charLeftWeaponGo = transform.gameObject; } if (transform.name == "currentWaypoint") { this.currentWaypoint = transform.gameObject; } if (transform.name == "lastPlayerSighting") { this.lastSighting = transform.gameObject; } if (transform.name == "tempLookat") { this.lookatTr = transform; } if (transform.name == "char_club_mesh1") { this.weapon = transform.gameObject; } if (transform.name == "FireStick") { this.fireWeapon = transform.gameObject; } if (transform.name == "char_RightHand") { this.clawsWeapon = transform.gameObject; } if (transform.name == "weaponLeftGO") { this.leftWeapon = transform.gameObject; } if (transform.name == "weaponLeftGO1") { this.leftWeapon1 = transform.gameObject; } if (transform.name == "weaponRightGO") { this.rightWeapon = transform.gameObject; } if (transform.name == "mainHitTrigger") { this.mainWeapon = transform.gameObject; } if (transform.name == "fireBomb") { this.fireBombGo = transform.gameObject; } if (transform.name == "dragPointGo") { this.familyFunctions.dragPoint = transform.gameObject; } if (transform.name == "bodyCollision") { if (this.pmCombat) { this.pmCombat.FsmVariables.GetFsmGameObject("bodyCollisionGo").Value = transform.gameObject; } this.bodyCollisionCollider = transform.GetComponent <CapsuleCollider>(); } if (transform.name == "char_LeftFoot") { this.leftFoot = transform; } if (transform.name == "headCollision") { this.headColliderGo = transform.gameObject; } } }
private void Start() { this.animControl = base.transform.GetComponent<mutantAnimatorControl>(); this.baseTr = base.transform; this.ankleToGroundOffset = this.leftFootTarget.position.y - this.baseTr.position.y; }