private void RespawnObjectRPC(NetworkViewID spawnPointOwner, int spawnPointID) { //Debug.Log("RespawnObjectRPC received."); GameObject spawnPoint = base.GetObject(spawnPointOwner, spawnPointID); PlayerRespawner respawner = spawnPoint.GetComponent <PlayerRespawner>(); respawner.Respawn(); }
void Start() { // TIDYME: 2018-07-08: Use property, rather than GetComponent respawner = GetComponent <CameraFollowPlayer>().followObj.GetComponent <PlayerRespawner>(); if (respawner == null) { Debug.Log("Respawner is null in the object the camera is following!!"); } }
void ClickedWarp(object ctx) { PlayerRespawner activeInstance = PlayerRespawner.GetActiveInstance(); if (activeInstance != null) { base.Owner.Hide(); activeInstance.ForceRespawn(); } }
public static PlayerRespawner GetActiveInstance() { for (int i = PlayerRespawner.allRespawners.Count - 1; i >= 0; i--) { PlayerRespawner playerRespawner = PlayerRespawner.allRespawners[i]; if (playerRespawner.ent != null && !playerRespawner.ent.InactiveOrDead && !playerRespawner.inForceRespawn) { return(playerRespawner); } } return(null); }
public void RpcDie() { hasControl = false; characterController.enabled = false; Instantiate(deathParticleSystemObject, gameObject.transform.position, gameObject.transform.rotation); isAlive = false; mesh.SetActive(false); playerRespawner = FindObjectOfType <PlayerRespawner>(); if (playerRespawner != null) { playerRespawner.CmdRespawn(gameObject); } }
/// <summary> /// Gets called when the Player changes state /// </summary> public override void OnContextChange() { // Player just died // Change the sprite of the player this.Context.SetSprite(this.Context.BatchName, SpriteEntityManager.Self.Find(Sprite.Name.DeadPlayer)); this.deathSound.Play(); // Create the respawner PlayerRespawner respawner = new PlayerRespawner(); // Add self to the timer TimedEventManager.Active.Create(this, respawner.RespawnWait * 0.5f); }
// Use this for initialization void Start() { WallBuilder = transform.GetComponent <CorriderWallBuilder>(); PlayerRespawner = transform.GetComponent <PlayerRespawner>(); if (WallBuilder) { WallWidth = WallBuilder.WallWidth; WallHeight = WallBuilder.WallHeight; } coroutine_enemySpawn = StartCoroutine(SpawnEnemyCube(spawn_delay)); coroutine_enemyRedSpawn = StartCoroutine(SpawnEnemyRedCube(spawn_red_delay)); }
void Start() { characterSounds = GetComponentInChildren <CharacterSounds>(); _characterInput = GetComponent <PlatformerCharacter2D>(); if (IsPlayer) { respawner = GetComponent <PlayerRespawner>(); } if (SpawnUponDeath != null) { spawnUponDeathScale = this.transform.localScale; } }
protected override void Initialize() { if (!GlobalSettings.SinglePlayer) { PlayerRespawner[] respawnpoints = FindObjectsOfType<PlayerRespawner>(); foreach (PlayerRespawner spawner in respawnpoints) if (spawner.gameObject.layer == gameObject.layer) { RespawnPoint = spawner; break; } } else this.RespawnPoint = GameObject.Find("Spawnpoint_Player1").GetComponent<PlayerRespawner>(); }
protected override void Initialize() { if (!GlobalSettings.SinglePlayer) { PlayerRespawner[] respawnpoints = FindObjectsOfType <PlayerRespawner>(); foreach (PlayerRespawner spawner in respawnpoints) { if (spawner.gameObject.layer == gameObject.layer) { RespawnPoint = spawner; break; } } } else { this.RespawnPoint = GameObject.Find("Spawnpoint_Player1").GetComponent <PlayerRespawner>(); } }
protected override bool DoShow(MenuScreen <PauseMenu> previous) { GuiContentData guiContentData = new GuiContentData(); guiContentData.SetValue("showMap", base.Owner._mapWindow.CanShow(base.Owner.currEnt)); bool flag = !PlayerRespawner.RespawnInhibited() && PlayerRespawner.GetActiveInstance() != null; guiContentData.SetValue("canWarp", flag); if (flag) { IDataSaver saver = base.Owner._saver.GetSaver("/local/start", true); if (saver != null) { guiContentData.SetValue("hasWarpTgt", true); guiContentData.SetValue("warpTgt", saver.LoadData("level")); } else { guiContentData.SetValue("hasWarpTgt", false); } } base.Root.ApplyContent(guiContentData, true); return(true); }
public override void OnStartServer() { playerRespawner = FindObjectOfType <PlayerRespawner>(); }
void Start() { respawner = (PlayerRespawner)FindObjectOfType(typeof(PlayerRespawner)); }
void Start() { player = GameObject.FindWithTag("Player").GetComponent<PlayerController>(); playerRespawner = player.GetComponent<PlayerRespawner>(); }
void Awake() { audioSource = GetComponent <AudioSource>(); respawner = GetComponent <PlayerRespawner>(); }
// Use this for initialization void Start() { Instance = this; }
private void Start() { respawner = GameObject.Find("PlayerRespawner").GetComponent <PlayerRespawner>(); musicplayer = GameObject.Find("Music Player").GetComponent <MusicPlayer>(); }