public IEnumerator ReloadLoadSceneSmoth() { _resetingPosition = true; _roy = null; _klunk = null; bool ok = false; LeanTween.value(gameObject, (x) => { _hidder.alpha = x; }, 0, 1, _fadeInTime) .setEase(_fadeInType) .setOnComplete(() => { ok = true; }); yield return(new WaitUntil(() => { return ok; })); yield return(SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().buildIndex)); LeanTween.value(gameObject, (x) => { _hidder.alpha = x; }, 1, 0, _fadeOutTime) .setEase(_fadeOutType); _resetingPosition = false; SceneFlow currentSceneFlow = FindObjectOfType <SceneFlow>(); if (currentSceneFlow == null) { Destroy(gameObject); yield break; } _bounds = currentSceneFlow._bounds; _finishZone = currentSceneFlow._finishZone; _roy = FindObjectOfType <Roy>(); _klunk = FindObjectOfType <Klunk>(); Destroy(currentSceneFlow.gameObject); }
// Use this for initialization void Start() { button = this.GetComponent <Button>(); sceneFlow = FindObjectOfType <SceneFlow>(); firebase = FindObjectOfType <FirebaseAPI>(); button.onClick.AddListener(SceneChange); }
void Start() { button = this.GetComponent <Button>(); sceneFlow = FindObjectOfType <SceneFlow>(); button.onClick.AddListener(UpdateCurrentPage); firebaseE = FindObjectOfType <FirebaseAPIEmployee>(); firebaseR = FindObjectOfType <FirebaseAPIRegistration>(); }
private void OnEnable() { float t = 0.05f; if (SceneManager.GetActiveScene().name == SceneFlow.GetSceneName(SceneList.Credits)) { t = 1.5f; } else if (SceneManager.GetActiveScene().name == SceneFlow.GetSceneName(SceneList.MainTitle)) { t = 2f; } StartCoroutine(SetFirstOption(t)); }
void CheckHealth() { if (enemy.health <= 0 || player.health <= 0) { Debug.Log("End Game Early"); GM.playerHealth = player.health; //if player wins disable the ui and turn the collection ui on if (GM.playerHealth == 0) { SceneFlow.RunScene(SceneList.MainScene); } else { StopAllCoroutines(); battleUI.SetActive(false); cardPickerUI.SetActive(true); } } }
private void FixedUpdate() { if (_end) { return; } Collider[] cols = Physics.OverlapBox(transform.position, _killZone.extents, Quaternion.identity, _whereIsPlayers); if (cols.Length > 0) { SceneFlow sceneFlow = FindObjectOfType <SceneFlow>(); if (sceneFlow != null) { _end = true; sceneFlow.StartCoroutine(sceneFlow.ReloadLoadSceneSmoth()); } } }
public void ChangeScene(SceneFlow sFlow) { switch (sFlow) { case SceneFlow.PREVIOUS: if (_sceneIndex - 1 >= 0) { _sceneIndex--; } else { Application.Quit(); } break; case SceneFlow.CURRENT: break; case SceneFlow.NEXT: _sceneIndex++; break; case SceneFlow.INFO: _sceneIndex = 2; break; case SceneFlow.MENU: _sceneIndex = 0; break; } if (_sceneIndex >= 0) { SceneManager.LoadScene(_sceneIndex); } }
public void LoadMenu() { Time.timeScale = 1f; SceneFlow.RunScene(SceneList.MainMenu); }
public void StartBattle() { SavePlayerPosition(); SceneFlow.RunScene(SceneList.Battle); }
public void ExitShop() { //exit the shop maybe Debug.Log("Quit Shop"); SceneFlow.RunScene(SceneList.MainScene); }
public void AddCard(GameCard card) { //Debug.Log(card.relatedCard.nameOfCard); battleManager.player.currentDeck.unactiveDeck.Add(card.relatedCard); SceneFlow.RunScene(SceneList.MainScene); }
public void OpenShop() { SceneFlow.RunScene(SceneList.Shop); }
public void CallCredits() { SceneFlow.RunScene(SceneList.Credits); }
public void PlayGame() { SceneFlow.RunScene(SceneList.MainScene); }
//Rename Credits public void ReturnToMainMenu() { SceneFlow.RunScene(SceneList.MainMenu); }
void Start() { button = this.GetComponent <Button>(); sceneFlow = FindObjectOfType <SceneFlow>(); button.onClick.AddListener(UpdateCurrentPage); }
public void Start() { sceneLoader = FindObjectOfType <SceneFlow>(); }