void Respawn() { transform.position = Game.game.findSpawnPosition(playerNr); PlayerLocal local = GetComponent <PlayerLocal>(); if (local != null) { local.MyMoveInit(); } }
void OnCollisionEnter(Collision collision) { if (Time.time > nextbloodt) { if (PlayerLocal.BloodAgainstObjectAllowed(collision.gameObject)) { foreach (ContactPoint contact in collision.contacts) { PlayerLocal.SpawnBloodOnContact2(contact.point, contact.normal); nextbloodt = Time.time + fBloodInterval; } } } }
/// <summary> /// Joins the room/game listed on the lobby. /// </summary> public void JoinRoom(string room) { if (!this.usePhoton.Player.gameObject.GetComponent<PlayerLocal>()) { // create a player Transform instance this.PlayerLocal = this.usePhoton.Player.gameObject.AddComponent<PlayerLocal>(); this.PlayerLocal.Initialize(this); this.PlayerLocal.name = this.LocalPlayer.Name + this.LocalPlayer.ID; this.chatScreen = this.usePhoton.chatScreen; this.chatScreen.NameSender = this.LocalPlayer.Name; } this.OpJoinRoom(room); this.chatScreen.Initialize(this); }