public void ActivatePowerUp() { switch (type) { case PowerUpType.PopulationGrowth: PersonSpawner.SpawnExtraPersons(1); NotificationManager.Notify(NotificationType.PopulationPowerUp); break; case PowerUpType.ExtraCannon: FindObjectOfType <Cannon>().AddExtraCannonBall(1); NotificationManager.Notify(NotificationType.ExtraCannonPowerUp); break; case PowerUpType.SpeedIncrease: PersonMovementController.UpdatePersonSpeed(); NotificationManager.Notify(NotificationType.SpeedPowerUp); break; default: throw new ArgumentOutOfRangeException(); } UpdatePowerUpCost(); }
void Awake() { myAnimator = this.GetComponent <Animator> (); myAesthetic = this.GetComponent <ArtemAestheticController> (); pmc = transform.root.gameObject.GetComponent <PersonMovementController> (); pwc = transform.root.gameObject.GetComponent <PersonWeaponController> (); }
void Awake() { pmc = this.gameObject.GetComponentInParent <PersonMovementController> (); pwc = this.gameObject.GetComponentInParent <PersonWeaponController> (); myHealth = this.gameObject.GetComponentInParent <PersonHealth> (); myAesthetic = this.GetComponent <PersonAestheticStore> (); setBodySprites(); myRenderers = this.transform.root.gameObject.GetComponentsInChildren <SpriteRenderer> (); }
void Update() { if (CommonObjectsStore.player == null) { player = GameObject.FindGameObjectWithTag("Player"); pwc = player.GetComponent <PersonWeaponController> (); pm = player.GetComponent <PersonMovementController> (); pcc = player.GetComponent <PersonClothesController> (); } }
// Use this for initialization void Start() { myAnimator = this.GetComponent <Animator> (); myAesthetic = this.GetComponent <ArtemAestheticController> (); pmc = transform.root.gameObject.GetComponent <PersonMovementController> (); pwc = transform.root.gameObject.GetComponent <PersonWeaponController> (); rightHand = myAesthetic.rHandObj; leftHand = myAesthetic.lHandObj; setMovingForward(); }
void OnTriggerExit2D(Collider2D col) { if (isTearGas == true) { if (col.gameObject.tag == "NPC" || col.gameObject.tag == "Player") { PersonMovementController pmc = col.gameObject.GetComponent <PersonMovementController> (); pmc.slowedMovement = false; } } }
void Awake() { pmc = this.GetComponent <PersonMovementController> (); pwc = this.GetComponent <PersonWeaponController> (); inv = this.GetComponent <Inventory> (); detect = this.GetComponent <CanWeDetectTarget> (); pf = this.GetComponent <PathFollower> (); memory = this.GetComponent <NPCMemory> (); npcB = this.GetComponent <NPCBehaviourDecider> (); myCol = this.GetComponent <PersonColliderDecider> (); myHealth = this.gameObject.GetComponent <PersonHealth> (); ac = this.GetComponentInChildren <ArtemAnimationController> (); pcc = this.GetComponent <PersonClothesController> (); }
void Awake() { me = this; mainCam = Camera.main; player = GameObject.FindGameObjectWithTag("Player"); pwc = player.GetComponent <PersonWeaponController> (); pm = player.GetComponent <PersonMovementController> (); pcc = player.GetComponent <PersonClothesController> (); if (LoadingDataStore.me == null) { GameObject g = new GameObject(); g.name = "Load Data Store"; g.AddComponent <LoadingDataStore> (); } }
void Awake() { me = this; pmc = this.gameObject.GetComponent <PersonMovementController> (); pwc = this.gameObject.GetComponent <PersonWeaponController> (); }
public override void doAction() { illigal = true; //this.transform.parent = CommonObjectsStore.player.transform; //this.gameObject.transform.rotation = Quaternion.Euler (0, 0, 0); if (hostage == null) { hostage = this.GetComponent <NPCController> (); } if (hostage.currentBehaviour == null) { } else { Destroy(hostage.currentBehaviour); } if (hostage.myHealth.healthValue <= 0) { onComplete(); } else { doing = true; if (hostage.npcB.myType != AIType.hostage) { hostage.npcB.myType = AIType.hostage; this.gameObject.tag = "NPC"; hostage.detect.fov.viewMeshFilter.gameObject.SetActive(false); Inventory i = this.gameObject.GetComponent <Inventory> (); List <Item> items = i.inventoryItems; foreach (Item it in items) { it.dropItem(); } i.inventoryItems.Clear(); //PersonAnimationController pac = this.gameObject.GetComponent<PersonAnimationController> (); //pac.animationsToPlay.Clear (); //pac.playAnimation ("TiedUp", false); //pac.playing = null; //pac.forceFinishCurrentAnim (); //hostage.head.gameObject.SetActive (false); //hostage.knockedDown = false; // this.gameObject.GetComponent<Collider2D> ().isTrigger = true; PlayerActionUI.me.lastObjectSelected = null; this.gameObject.GetComponent <PersonColliderDecider>().setTrigger(); PersonWeaponController pwc = this.gameObject.GetComponent <PersonWeaponController> (); if (pwc.currentWeapon == null) { } else { pwc.currentWeapon.dropItem(); pwc.currentWeapon = null; } pwc.enabled = false; pmc = this.gameObject.GetComponent <PersonMovementController> (); this.gameObject.transform.position = CommonObjectsStore.player.transform.position + (CommonObjectsStore.player.transform.up / 2); this.gameObject.transform.parent = CommonObjectsStore.player.transform; this.gameObject.transform.rotation = Quaternion.Euler(0, 0, CommonObjectsStore.player.transform.eulerAngles.z); player_pmc = CommonObjectsStore.player.GetComponent <PersonMovementController> (); this.gameObject.GetComponent <SpriteRenderer> ().sortingOrder = 4; } else { wasHostageBefore = true; hostage.npcB.myType = AIType.hostage; this.gameObject.tag = "NPC"; hostage.detect.fov.viewMeshFilter.gameObject.SetActive(false); //Inventory i = this.gameObject.GetComponent<Inventory> (); //List<Item> items = i.inventoryItems; //foreach (Item it in items) { // it.dropItem (); //} //i.inventoryItems.Clear (); ////PersonAnimationController pac = this.gameObject.GetComponent<PersonAnimationController> (); //pac.animationsToPlay.Clear (); //pac.playAnimation ("TiedUp", false); //pac.playing = null; //pac.forceFinishCurrentAnim (); //hostage.head.gameObject.SetActive (false); //hostage.knockedDown = false; //this.gameObject.GetComponent<Collider2D> ().isTrigger = true; this.gameObject.GetComponent <PersonColliderDecider>().setTrigger(); PersonWeaponController pwc = this.gameObject.GetComponent <PersonWeaponController> (); if (pwc.currentWeapon == null) { } else { pwc.currentWeapon.dropItem(); pwc.currentWeapon = null; } pwc.enabled = false; pmc = this.gameObject.GetComponent <PersonMovementController> (); this.gameObject.transform.position = CommonObjectsStore.player.transform.position + (CommonObjectsStore.player.transform.up / 2); this.gameObject.transform.parent = CommonObjectsStore.player.transform; this.gameObject.transform.rotation = Quaternion.Euler(0, 0, CommonObjectsStore.player.transform.eulerAngles.z); player_pmc = CommonObjectsStore.player.GetComponent <PersonMovementController> (); this.gameObject.GetComponent <SpriteRenderer> ().sortingOrder = 4; } this.gameObject.transform.position = CommonObjectsStore.player.transform.position + (CommonObjectsStore.player.transform.up / 2); this.gameObject.GetComponentInChildren <CircleCollider2D> ().enabled = false; pmc.movedThisFrame = player_pmc.movedThisFrame; hostage.ac.setHumanShield(); //pmc.legAnimate (); if (hostage.detect.fov.viewMeshFilter.gameObject.activeInHierarchy == true) { hostage.detect.fov.viewMeshFilter.gameObject.SetActive(false); } if (PlayerAction.currentAction != this && transform.parent != null) { PlayerAction.currentAction = this; } } //if (Input.GetKeyDown (KeyCode.E)) { // onComplete (); //} //if (setRot == false) { //this.transform.position = Vector3.zero; //this.gameObject.transform.position = CommonObjectsStore.player.transform.position - Vector3.up; // setRot = true; //} }