public void Continue() { gameStarted = true; StopAllCoroutines(); continueButton.SetActive(false); slider.transform.DOLocalMoveX(sliderStartingX, 0.5f); CancelInvoke("DeActivateSlowMotion"); UIPop.instance.Continue(); StopAllCoroutines(); powerupFillImage.fillAmount = 0; GameOver.SetActive(false); InGame.SetActive(true); foreach (GameObject item in createdPuzzel) { ReassignSpawnedCount(item.transform.GetChild(0).GetComponent <Puzzle>().indexofpuzzle); enemyCount += 1; Destroy(item); } DeActivateSlowMotion(); createdPuzzel.Clear(); Player.instance.isDead = false; Player.instance.puzzle.transform.DORotate(new Vector3(0, 0, 0), 0.1f).OnComplete(() => { Player.instance.isReady = true; Player.instance.currentAngle = 0; Player.instance.UpdateStatuesofPlayer(); Player.instance.isClose = false; gameOver = false; }); StartCoroutine(Spawn(TimeGap)); OnIdleAnimation(); DeactivareContinue(); }
public void StartGame() { //GameAnalytics.NewProgressionEvent(GAProgressionStatus.Start, "game"); foreach (CharecterSelection item in charecterSelection) { //item.charecter.SetActive(false); item.charecter.transform.localScale = Vector3.zero; item.charecter.transform.GetChild(0).transform.GetChild(0).GetComponent <StopObjectFromRotating>().enabled = false; } int indexofCurrectCharecter = PlayerPrefs.GetInt("CurrentActiveCharecter", 0); charecterSelection[indexofCurrectCharecter].charecter.transform.DOScale(1, 0.5f); charecterSelection[indexofCurrectCharecter].charecter.transform.GetChild(0).transform.GetChild(0).GetComponent <StopObjectFromRotating>().enabled = true; Player.instance.degree = charecterSelection[indexofCurrectCharecter].directions; gameStarted = true; camPosition = GameCam.transform.position; orthoSize = GameCam.fieldOfView; camScaleValue = GameCam.transform.localScale.x; BgScaleValue = BG.transform.localScale.x; print(BgScaleValue); MainMenu.SetActive(false); powerupFillImage.fillAmount = 0; Time.timeScale = 1; InGame.SetActive(true); StartCoroutine(Spawn(TimeGap)); }
public void gameStart() { Time.timeScale = 1; JoyStick.SetActive(true); HP.SetActive(true); Panel.SetActive(false); InGame.SetActive(true); }
void Awake() { _instance = this; Menu.SetActive(false); Levels.SetActive(false); InGame.SetActive(false); Staff.SetActive(false); Back.SetActive(false); }
public void Open(EnumType.UIType uiType) { if (uiType != EnumType.UIType.Staff) { _currentShowUI = uiType; } switch (uiType) { case EnumType.UIType.Menu: Menu.SetActive(true); Menu.transform.FindChild("1P").GetComponent <UIButton>().isEnabled = false; Levels.SetActive(false); InGame.SetActive(false); Staff.SetActive(false); Back.SetActive(false); break; case EnumType.UIType.Levels: Menu.SetActive(false); Levels.SetActive(true); InGame.SetActive(false); Staff.SetActive(false); Back.SetActive(true); break; case EnumType.UIType.InGame: Menu.SetActive(false); Levels.SetActive(false); InGame.SetActive(true); Staff.SetActive(false); Back.SetActive(true); break; case EnumType.UIType.Staff: Menu.SetActive(false); Levels.SetActive(false); InGame.SetActive(false); Staff.SetActive(true); Back.SetActive(true); break; } }
public void OnGameOver() { gameStarted = false; SaveScore(); DOTween.KillAll(); InGame.SetActive(false); GameOver.SetActive(true); DOTween.KillAll(); PlayerPrefs.SetFloat("CoinsCollected", PlayerPrefs.GetFloat("CoinsCollected") + coin); coinsCollected = PlayerPrefs.GetFloat("CoinsCollected", 0) + coin; coinsCollectedText.text = coinsCollected.ToString(); StartCountDown(); EndScoreTxt.text = Player.instance.score.ToString(); IncreaseXp(); LoadScore(); CheckSpeed(Player.instance.score); // GameAnalytics.NewProgressionEvent(GAProgressionStatus.Complete,"game", Player.instance.score); }