//float offR = 200f / 255f; //float offG = 0f / 255f; //float offB = 0f / 255f; //float offA = 25f / 255f; #endregion #region Getters/Setters #endregion #region Constructors #endregion // ------------------------------------------------------------------------------ // FUNCTIONS // ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------ // Function Name: // Return types: // Argument types: // Author: // Date: // ------------------------------------------------------------------------------ // Purpose: // ------------------------------------------------------------------------------ void Start() { wld_Teleporter = GetComponent<WLD_Teleporter>(); levelSeg = WLD_GameController.levels[wld_Teleporter.levelToLoad].LevelSegments.Length; teleporterRenderer = GetComponent<Renderer>(); segmentButtons = new Button[segmentNumber.Length]; for (int i = 0; i < segmentNumber.Length; i++) { segmentButtons[i] = segmentNumber[i].GetComponent<Button>(); segmentNumber[i].SetActive(false); segmentButtons[i].interactable = false; } shopPanel.SetActive(false); ev = GameObject.Find("SegmentEventSystems").GetComponent<EventSystem>(); }
// ------------------------------------------------------------------------------ // FUNCTIONS // ------------------------------------------------------------------------------ void Start() { player = WLD_GameController.player; teleporter = GetComponent<WLD_Teleporter>(); hub_ui = GetComponent<UI_HubUI>(); }
private void Start() { segmentNumber = teleporterOn.GetComponent <WLD_Teleporter>().segmentNumber; wld_Teleporter = teleporterOn.GetComponent <WLD_Teleporter>(); if (WLD_GameController.player.GetComponent <PLR_Points>().LastSegment != 1) { if (WLD_GameController.activeLevel.LevelSegments[teleporterOn.GetComponent <WLD_Teleporter>().segmentNumber - 2].SegmentComplete) { teleporterOn.SetActive(true); teleporterOff.SetActive(false); teleporterReached = true; } } }
void DeathRespawnBehave() { if (wld_HealthDmg.Health <= 0) { isDying = true; if (isDying && currentTime == 0) { audioSource.PlayOneShot(deathSound); } currentTime += Time.deltaTime; anim.SetTrigger(hashIDs.deathBool); if (timeToDie <= currentTime) { isDead = true; currentTime = 0; //rb.velocity = Vector3.zero; //rb.angularVelocity = Vector3.zero; //transform.position = new Vector3(WLD_GameController.activeLevel.LevelSegments[segNumber - 1].TeleporterX, WLD_GameController.activeLevel.LevelSegments[segNumber - 1].TeleporterY, WLD_GameController.activeLevel.LevelSegments[segNumber - 1].TeleporterZ); //PlayerReset(); if (reloadLevel == false) { StartCoroutine(Death()); } else if (reloadLevel == true) { for (int i = 0; i < WLD_GameController.levels.Count; i++) { if (WLD_GameController.levels[(Scenes)i] == WLD_GameController.activeLevel) { invinsiblity = true; WLD_Teleporter teleporter = FindObjectOfType <WLD_Teleporter>(); rb.velocity = Vector3.zero; rb.angularVelocity = Vector3.zero; teleporter.LevelToLoad = (Scenes)i; PlayerReset(); teleporter.LoadLevelSegment(WLD_GameController.player.GetComponent <GRV_IndividualGravity>().Segment.SegmentNumber); } } } } } }
// ------------------------------------------------------------------------------ // Function Name: RestartButton // Return types: // Argument types: // Author: Kayci Lyons // Date: 10/19/17 // ------------------------------------------------------------------------------ // Purpose: When the function is called, it resets the player to the last teleporter they activated. // ------------------------------------------------------------------------------ public void RestartButton() { for (int i = 0; i < WLD_GameController.levels.Count; i++) { if (WLD_GameController.levels[(Scenes)i] == WLD_GameController.activeLevel) { WLD_Teleporter teleporter = FindObjectOfType <WLD_Teleporter>(); PLR_DeathRespawnCycle reset = FindObjectOfType <PLR_DeathRespawnCycle>(); teleporter.LevelToLoad = (Scenes)i; teleporter.LoadLevelSegment(WLD_GameController.player.GetComponent <GRV_IndividualGravity>().Segment.SegmentNumber); reset.PlayerReset(); } } ui_Pause.UnpauseButton(); EndPieceLoreElementsRestart(); SaveNotificationRestart(); FireRateRestart(); HealthOverlayReset(); ColdEffectRestart(); HeatZoneReset(); }