public void BtnContinueOnclick() { if (!isClick) { if (PlayerPrefs.GetInt("Continue") != 0 && PlayerPrefs.GetInt("isTutorial") != 0) { isClick = true; isContinue = true; AudioManager.Instance.Play("Click"); AudioManager.Instance.Stop("Menu", true); AudioManager.Instance.Play("GamePlay", true); DataPlayer.Instance.LoadDataPlayer(); contentWorld.anchoredPosition = Vector3.zero; ScenesManager.Instance.GoToScene(ScenesManager.TypeScene.Main, () => { isSaveJson = true; scene = TypeScene.WOLRD; isClick = false; }); } else { BtnYesPlayOnclick(); } } }
private IEnumerator GoToSceneHandel(TypeScene typeScene, UnityAction actionLoadScenesDone = null) { Fade.Instance.StartFade(); yield return(new WaitUntil(() => Fade.Instance.state == Fade.FadeState.FadeInDone)); secenes[currentScenes].objects.SetActive(false); for (int i = 0; i < secenes.Length; i++) { if (secenes[i].type == typeScene) { currentScenes = i; secenes[currentScenes].objects.SetActive(true); break; } } if (actionLoadScenesDone != null) { actionLoadScenesDone(); } yield return(new WaitForSeconds(0.02f)); Fade.Instance.EndFade(); }
public void Start() { scene = TypeScene.HOME; if (!PlayerPrefs.HasKey("isTutorial")) { PlayerPrefs.SetInt("isTutorial", 0); } if (!PlayerPrefs.HasKey("Continue")) { PlayerPrefs.SetInt("Continue", 0); btncontinue.interactable = false; } else { if (PlayerPrefs.GetInt("Continue") == 0) { btncontinue.interactable = false; } else { btncontinue.interactable = true; } } for (int i = 0; i < 4; i++) { for (int j = 0; j < arrAlphabet.Length; j++) { arrAlphabetNeed.Add(arrAlphabet[i] + arrAlphabet[j]); } } }
public void CloseJob() { scene = TypeScene.LOCATION; int id = GameManager.Instance.IDLocation; int indexType = GameManager.Instance.lsLocation[id].indexType; GameManager.Instance.lsTypeMiniGame[GameManager.Instance.lsLocation[id].indexTypeWork].lsMiniGame[indexType].miniGame.SetActive(false); GameManager.Instance.lsLocation[id].lsWorking[indexType].isXJob = false; AudioManager.Instance.Stop("Felling"); AudioManager.Instance.Stop("Drill"); AudioManager.Instance.Stop("Debarking"); AudioManager.Instance.Stop("Saw"); AudioManager.Instance.Stop("Painting"); AudioManager.Instance.Stop("Water"); AudioManager.Instance.Stop("Polish"); }
private IEnumerator GoToSceneHandel(TypeScene typeScene, UnityAction actionLoadScenesDone = null) { Fade.Instance.StartFade(); yield return(new WaitUntil(() => Fade.Instance.state == Fade.FadeState.FadeInDone)); secenes[0].objects.SetActive(false); if (actionLoadScenesDone != null) { actionLoadScenesDone(); } yield return(new WaitForSeconds(1.5f)); //Hazz yield return(new WaitUntil(() => isNextScene = true)); Fade.Instance.EndFade(); }
public void SaveExit() { ClosePupopFull(); scene = TypeScene.HOME; txtRevenue.enabled = true; AudioManager.Instance.Play("Menu", true); AudioManager.Instance.Stop("GamePlay", true); AudioManager.Instance.Play("Click"); DataPlayer.Instance.SaveExit(); panelSetting.SetActive(false); ScenesManager.Instance.secenes[0].objects.SetActive(true); if (PlayerPrefs.GetInt("Continue") == 0) { btncontinue.interactable = false; } else { btncontinue.interactable = true; } }
public void BtnYesPlayOnclick() { if (!isClick) { isClick = true; isContinue = false; AudioManager.Instance.Play("Click"); AudioManager.Instance.Stop("Menu", true); AudioManager.Instance.Play("GamePlay", true); popupStart.SetActive(false); popupHome.SetActive(true); ScenesManager.Instance.isNextScene = false; GameManager.Instance.sumHomeAll = 0; GameManager.Instance.LoadDate(); GameManager.Instance.dollar = GameConfig.Instance.dollarStart; if (GameManager.Instance.gold < GameConfig.Instance.goldStart) { GameManager.Instance.gold = GameConfig.Instance.goldStart; } GameManager.Instance.ClearLocation(); GameManager.Instance.CreatLocation(lsLocationUI[0], true); handWorld.position = lsLocationUI[0].transform.GetChild(0).position - new Vector3(0f, 0.25f, 0f); contentWorld.anchoredPosition = Vector3.zero; if (PlayerPrefs.GetInt("isTutorial") == 0) { GameManager.Instance.lsLocation[0].GetComponent <ScrollRect>().vertical = false; } ScenesManager.Instance.GoToScene(ScenesManager.TypeScene.Main, () => { isSaveJson = true; scene = TypeScene.WOLRD; isClick = false; if (PlayerPrefs.GetInt("isTutorial") == 0) { panelWaitGrow.SetActive(true); txtWait.text = "Tap to Africa"; Ads.Instance.HideBanner(); } }); } }
public void BtnBackToWorld() { if (scene != TypeScene.WOLRD) { CloseJob(); txtRevenue.enabled = true; scene = TypeScene.WOLRD; AudioManager.Instance.Play("Click"); locationManager.transform.SetAsFirstSibling(); panelSetting.SetActive(false); } else { ClosePupopFull(); scene = TypeScene.HOME; AudioManager.Instance.Play("Menu", true); AudioManager.Instance.Stop("GamePlay", true); AudioManager.Instance.Play("Click"); DataPlayer.Instance.SaveExit(); panelSetting.SetActive(false); ScenesManager.Instance.secenes[0].objects.SetActive(true); } }
public void GoToScene(TypeScene typeScene, UnityAction actionLoadScenesDone = null) { StartCoroutine(GoToSceneHandel(typeScene, actionLoadScenesDone)); }