}//End Start /* ------------------------------------------------------------------------------ * Function Name: Update * Return types: N/A * Argument types: N/A * Author: * Date Created: * Last Updated: * ------------------------------------------------------------------------------ * Purpose: Runs each frame. Used to perform frame based checks and actions. * ------------------------------------------------------------------------------ * */ private void OnStart() { optionEventSystem = GameObject.Find("OptionEventSystem").GetComponent <EventSystem>(); gameControllerEventSystems = GameObject.Find("GameControllerEventSystem").GetComponent <EventSystem>(); lL = FindObjectOfType <WLD_LevelLoader>(); player = WLD_GameController.player; plr_shoot = FindObjectOfType <PLR_Shoot>(); plr_CharacterMovement = player.GetComponent <PLR_CharacterMovement>(); isInLanding = true; if (player.transform.position.x <= 1 && player.transform.position.x >= -1) { player.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0); plr_CharacterMovement.enabled = false; plr_shoot.enabled = false; onStartRan = true; } else { landingSequence.SetActive(false); onStartRan = true; } }
// ------------------------------------------------------------------------------ // Function Name: // Return types: // Argument types: // Author: // Date: // ------------------------------------------------------------------------------ // Purpose: // ------------------------------------------------------------------------------ private void RunOnStart() { player = WLD_GameController.player; plr_CharacterMovement = FindObjectOfType<PLR_CharacterMovement>(); plr_Shoot = FindObjectOfType<PLR_Shoot>(); //plr_Jump = FindObjectOfType<PLR_Jump>(); lL = FindObjectOfType<WLD_LevelLoader>(); }
// ------------------------------------------------------------------------------ // FUNCTIONS // ------------------------------------------------------------------------------ void Update() { if (WLD_GameController.activeLevel == WLD_GameController.levels[Scenes.Tutorial]) { skipButton.enabled = true; } player = WLD_GameController.player; lL = FindObjectOfType<WLD_LevelLoader>(); plr_shoot = FindObjectOfType<PLR_Shoot>(); RestoreAbilities(); ToggleSkipButton(); }
}//End Start private void OnStart() { lL = FindObjectOfType <WLD_LevelLoader>(); player = WLD_GameController.player; plr_shoot = FindObjectOfType <PLR_Shoot>(); plr_CharacterMovement = player.GetComponent <PLR_CharacterMovement>(); isInLanding = true; player.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0); plr_CharacterMovement.enabled = false; plr_shoot.enabled = false; onStartRan = true; }
void Awake() { rb = GetComponent <Rigidbody>(); //lL = FindObjectOfType<WLD_LevelLoader>(); //Ref to levelLoader script - will need to update to ref specific Teleporter's Segement selection later //Added to test InvertedGravity player_grv_individualGravity = this.GetComponent <GRV_IndividualGravity>(); //Finish Add //plr_Jump = GetComponent<PLR_Jump>(); plr_Shoot = FindObjectOfType <PLR_Shoot>(); healthScript = this.GetComponent <WLD_HealthDmg>(); rb.isKinematic = false; rb.useGravity = false; isFrozen = false; hashIDs = FindObjectOfType <UNA_HashIDs>(); anim = playerGFX.GetComponentInChildren <Animator>(); }
void OnStart() { if (WLD_GameController.activeLevel == WLD_GameController.levels[Scenes.Hub]) { msg = GameObject.Find("LevelSpecificUI/MessageSystem").GetComponent <WLD_MessageSystem>(); GetComponent <Collider>().enabled = true; player = WLD_GameController.player; plr_shoot = FindObjectOfType <PLR_Shoot>(); plr_Jump = FindObjectOfType <PLR_Jump>(); plr_CharacterMovement = player.GetComponent <PLR_CharacterMovement>(); } else { //store the message system msg = FindObjectOfType <WLD_MessageSystem>(); GetComponent <Collider>().enabled = true; player = WLD_GameController.player; plr_shoot = FindObjectOfType <PLR_Shoot>(); plr_CharacterMovement = player.GetComponent <PLR_CharacterMovement>(); } }
// ------------------------------------------------------------------------------ // FUNCTIONS // ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------ // Function Name: KeyBoardMenuScroll() // Return types: NA // Argument types: NA // Author: Joseph Aranda // Date: 9/27/17 // ------------------------------------------------------------------------------ // Purpose: Calls the functions every frame // ------------------------------------------------------------------------------ private void OnLevelWasLoaded(int level) { if (saveButton != null) { if (WLD_GameController.activeLevel == WLD_GameController.levels[Scenes.Tutorial]) { saveButton.interactable = false; } else { saveButton.interactable = true; } } lL = FindObjectOfType <WLD_LevelLoader>(); if (WLD_GameController.activeLevel != WLD_GameController.levels[Scenes.MainMenu]) { if (WLD_GameController.activeLevel != WLD_GameController.levels[Scenes.LoadGame]) { if (WLD_GameController.activeLevel != WLD_GameController.levels[Scenes.Controls]) { if (WLD_GameController.activeLevel != WLD_GameController.levels[Scenes.Credits]) { plr_Shoot = FindObjectOfType <PLR_Shoot>(); plr_CharacterMovement = FindObjectOfType <PLR_CharacterMovement>(); UI_Pause.isPaused = false; Time.timeScale = 1; if (WLD_GameController.ui_Texts[UI_Txt.SaveGameNotificationText] != null) { WLD_GameController.ui_Texts[UI_Txt.SaveGameNotificationText].enabled = false; } if (plr_CharacterMovement != null) { plr_CharacterMovement.enabled = true; } if (plr_Shoot != null) { plr_Shoot.enabled = true; } } } } } if (WLD_GameController.activeLevel == WLD_GameController.levels[Scenes.Hub]) { WLD_GameController.ui_GameObjects[UI_GO_Panels.GravityPanelSmallGo].SetActive(false); WLD_GameController.ui_GameObjects[UI_GO_Panels.GravityPanelShrink].SetActive(false); UI_SkipTutorial skipTut = FindObjectOfType <UI_SkipTutorial>(); skipTut.enabled = false; } else { WLD_GameController.ui_GameObjects[UI_GO_Panels.GravityPanelSmallGo].SetActive(true); } HeatZoneReset(); HealthOverlayReset(); ResetShrinkButtonFillIn(); }
// ------------------------------------------------------------------------------ // FUNCTIONS // ------------------------------------------------------------------------------ private void Awake() { bulletSpawnLocation = GameObject.Find("BulletSpawnLocation"); shootScript = bulletSpawnLocation.GetComponent <PLR_Shoot>(); }
// ------------------------------------------------------------------------------ // Function Name: // Return types: // Argument types: // Author: // Date: // ------------------------------------------------------------------------------ // Purpose: This function calls pause or unpause in all the other levels // ------------------------------------------------------------------------------ void CorePause() { if (!FindObjectOfType<WLD_LevelLoader>().loadingScreen.activeSelf) { currentLevel = WLD_GameController.activeLevel; if (currentLevel != WLD_GameController.levels[Scenes.MainMenu] || currentLevel != WLD_GameController.levels[Scenes.Hub] || currentLevel != WLD_GameController.levels[Scenes.Controls] || currentLevel != WLD_GameController.levels[Scenes.Credits]) { if (!isPaused) { if (Input.GetAxisRaw("Pause") > 0 && pauseButtonEnabled && currentLevel != WLD_GameController.levels[Scenes.Hub]) { plr_CharacterMovement = FindObjectOfType<PLR_CharacterMovement>(); plr_Shoot = FindObjectOfType<PLR_Shoot>(); WLD_GameController.ui_GameObjects[UI_GO_Panels.PausePanel].SetActive(!WLD_GameController.ui_GameObjects[UI_GO_Panels.PausePanel].activeSelf); isPaused = true; Time.timeScale = 0; plr_Shoot.enabled = false; plr_CharacterMovement.enabled = false; WLD_GameController.ui_GameObjects[UI_GO_Panels.GravityPanelSmallGo].SetActive(false); Debug.Log("Paused"); } } else if (isPaused) { if (Input.GetAxisRaw("Pause") > 0 && pauseButtonEnabled && currentLevel != WLD_GameController.levels[Scenes.Hub]) { plr_CharacterMovement = FindObjectOfType<PLR_CharacterMovement>(); plr_Shoot = FindObjectOfType<PLR_Shoot>(); //gGunEnlargeButton.enabled = true; WLD_GameController.ui_Texts[UI_Txt.SaveGameNotificationText].enabled = false; WLD_GameController.ui_GameObjects[UI_GO_Panels.GravityPanelSmallGo].SetActive(true); if (UNA_StaticVariables.isShrunk == false) { gameObject.GetComponent<UI_UIButtonManager>().GgunShrink(); } //if (topTimesScoresOverlay.activeSelf) //{ // return; //} //else if (!topTimesScoresOverlay.activeSelf) //{ // WLD_GameController.ui_GameObjects[UI_GO_Panels.PausePanel].SetActive(!WLD_GameController.ui_GameObjects[UI_GO_Panels.PausePanel].activeSelf); // isPaused = false; // Time.timeScale = 1; // gGunEnlargeButton.enabled = true; // WLD_GameController.ui_Texts[UI_Txt.SaveGameNotificationText].enabled = false; // if (!msgSystem.show) // { // plr_Shoot.enabled = true; // plr_CharacterMovement.enabled = true; // } // Debug.Log("UN-paused"); //} WLD_GameController.ui_GameObjects[UI_GO_Panels.PausePanel].SetActive(!WLD_GameController.ui_GameObjects[UI_GO_Panels.PausePanel].activeSelf); isPaused = false; Time.timeScale = 1; WLD_GameController.ui_Texts[UI_Txt.SaveGameNotificationText].enabled = false; if (!msgSystem.show) { plr_Shoot.enabled = true; plr_CharacterMovement.enabled = true; } Debug.Log("UN-paused"); if (helpMenu.activeSelf) { helpMenu.SetActive(false); WLD_GameController.ui_GameObjects[UI_GO_Panels.PausePanel].SetActive(true); isPaused = true; Time.timeScale = 0; plr_Shoot.enabled = false; plr_CharacterMovement.enabled = false; } if (!helpMenu.activeSelf) { UI_MenuManager.isHelpCkicked = false; helpEventSystem.enabled = false; gameControllerEventSystem.enabled = true; } if (saveMenu.activeSelf) { saveMenu.SetActive(false); WLD_GameController.ui_GameObjects[UI_GO_Panels.PausePanel].SetActive(true); isPaused = true; Time.timeScale = 0; plr_Shoot.enabled = false; plr_CharacterMovement.enabled = false; } if (!saveMenu.activeSelf) { UI_MenuManager.isSavedClicked = false; saveEventSystem.enabled = false; gameControllerEventSystem.enabled = true; } } } if (currentLevel != WLD_GameController.levels[Scenes.Tutorial]) { SetPauseButtonEnabled(); } } } }