void OnCollisionEnter(Collision coll) { if (coll.gameObject.name == "Player") { lastCheckpoint = CheckpointControl.chkDictP1 [CheckpointControl.chkLastP1]; RespawnControl.Respawn(coll.gameObject, lastCheckpoint); } if (coll.gameObject.name == "Player2") { lastCheckpoint = CheckpointControl.chkDictP2 [CheckpointControl.chkLastP2]; RespawnControl.Respawn(coll.gameObject, lastCheckpoint); } }
void OnTriggerEnter(Collider coll) { if (coll.gameObject.tag == "Player") { lastCheckpoint = CheckpointControl.chkDictP1 [CheckpointControl.chkLastP1]; RespawnControl.Respawn(coll.gameObject, lastCheckpoint); } if (coll.gameObject.tag == "Player2") { lastCheckpoint = CheckpointControl.chkDictP2 [CheckpointControl.chkLastP2]; RespawnControl.Respawn(coll.gameObject, lastCheckpoint); } }
//reverse direction upon collision with wall //kills player. void OnCollisionEnter(Collision coll) { if (enemyState == EnemyState.NORMAL) { speed *= -1f; } if (coll.gameObject.name == "Player") { lastCheckpoint = CheckpointControl.chkDictP1 [CheckpointControl.chkLastP1]; RespawnControl.Respawn(coll.gameObject, lastCheckpoint); } if (coll.gameObject.name == "Player2") { lastCheckpoint = CheckpointControl.chkDictP2 [CheckpointControl.chkLastP2]; RespawnControl.Respawn(coll.gameObject, lastCheckpoint); } }
void P2StartingSpawn(Player2Spawns spawn) { RespawnControl.Respawn(players [1], p2_spawndict [spawn]); }
void P1StartingSpawn(Player1Spawns spawn) { RespawnControl.Respawn(players [0], p1_spawndict [spawn]); }