public void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Hurtbox") { if (true) { if (!general) { other.gameObject.GetComponent <DamageReceiver> ().receiveDamage(damage, stunTime, dmgType, this.transform.root.tag, finisher, this.transform); } else { other.gameObject.GetComponent <DamageReceiver> ().receiveDamage(damage, stunTime, dmgType, "General", finisher, this.transform); } if (this.transform.root.gameObject.tag == "Player") { if (this.transform.root.gameObject.GetComponent <PlayerController> ().characterName == "Ronin") { RoninController rC = this.transform.root.gameObject.GetComponent <RoninController> (); rC.successfulHit = true; } } } if (hitCondition && this.gameObject.tag != "Projectile") { if (am != null) { if (this.transform.root.GetComponent <PlayerController> ().characterName == "X-42") { this.transform.root.GetComponent <X42Controller> ().InstantDeath(other.transform.root.gameObject); } am.HitSomething(1); } else { this.transform.root.GetComponent <Animator> ().SetTrigger("hitCondition"); } } if (this.gameObject.tag == "Projectile") { if (other.transform.root.gameObject.tag == "Enemy") { ProjectileProperties pp = this.GetComponent <ProjectileProperties> (); pp.Explode(hitCondition); } } if (!continuous) { StartCoroutine(maintainColliders()); } } }
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); }