public void RaiseEnergy() { pC = GameObject.FindObjectOfType <WondieController> (); if (pC != null) { energyRaised++; pC.GainKinergy(1); if (energyRaised >= 5) { EndMyLifePlease(); } } }
void CharacterSelect(Vector3 spawnPoint, int currentHP) { if (currentCharacter == "Captain Summers") { player = Instantiate(captainSummers, spawnPoint, Quaternion.identity); cameraFollow.target = player.transform; SummersController Scontroller = player.GetComponent <SummersController> (); Scontroller.effectManager = this.effectManager; Scontroller.camera = cameraShake; inputManager.controller = Scontroller; } if (currentCharacter == "The Wonder") { player = Instantiate(theWonder, spawnPoint, Quaternion.identity); cameraFollow.target = player.transform; WondieController Wcontroller = player.GetComponent <WondieController> (); Wcontroller.effectManager = this.effectManager; Wcontroller.camera = cameraShake; inputManager.controller = Wcontroller; } if (currentCharacter == "Ronin") { player = Instantiate(ronin, spawnPoint, Quaternion.identity); cameraFollow.target = player.transform; RoninController Rcontroller = player.GetComponent <RoninController> (); Rcontroller.effectManager = this.effectManager; Rcontroller.camera = cameraShake; inputManager.controller = Rcontroller; } if (currentCharacter == "X-42") { player = Instantiate(x42, spawnPoint, Quaternion.identity); cameraFollow.target = player.transform; X42Controller Xcontroller = player.GetComponent <X42Controller> (); Xcontroller.effectManager = this.effectManager; Xcontroller.camera = cameraShake; inputManager.controller = Xcontroller; } HUDManager hudM = FindObjectOfType <HUDManager> (); hudM.ChangeHUD(currentCharacter); }