public static void OnLoadStart() { LevelPlayground.SetLevelState(LevelPlayground.LevelState.Unknown); Scenes.GoToScene(Scenes.Types.Start); Server.Report(Server.ReportComands.RestartLevel); }
private void OnLose() { Destroy(gameObject); LevelPlayground.SetLevelState(LevelPlayground.LevelState.LoseLevel); Scenes.GoToScene(Scenes.Types.Result); }
public static void OnLoadLevel() { if (Scenes.PreviousScene == Scenes.Types.Result) { LevelPlayground.Resetlevels(); } Scenes.GoToScene(Scenes.Types.Level); }
public static void OnContinueLevelByMoney() { GameData.ReduceCurrency(Configs.Balance.PaymentForContinue); LevelPlayground.SetLevelState(LevelPlayground.LevelState.Unknown); Server.Report(Server.ReportComands.NextLevelByMoney); Scenes.GoToScene(Scenes.Types.Level); }
public static void OnContinueLevel() { LevelPlayground.Resetlevels(); LevelPlayground.SetLevelState(LevelPlayground.LevelState.Unknown); Server.Report(Server.ReportComands.NextLevel); Scenes.GoToScene(Scenes.Types.Level); }
public static void OnSceneLoading() { LevelPlayground.LoadLevels(); LevelPlayground.LoadPrefabs(); LevelPlayground.CreateWheel(); LevelPlayground.CreateBullets(); LevelPlayground.CreatePrizes(); LevelPlayground.CreateBarriers(); LevelPlayground.RenderPoints(); }
public static void OnNextBullet() { var state = LevelPlayground.GetLevelState(); if (state == LevelPlayground.LevelState.LoseLevel) { return; } LevelPlayground.SetNextBulletAsActive(); }
public static void OnSceneLoading() { var textResult = GameObject.Find("TextResult").GetComponent <Text>(); var textBody = GameObject.Find("TextBody").GetComponent <Text>(); var textPlay = GameObject.Find("TextPlay").GetComponent <Text>(); var buttonDeny = GameObject.Find("ButtonDeny"); var prize = GameObject.Find("CounterSmallPrize"); var counterText = GameObject.Find("CounterSmallText"); buttonDeny.GetComponentInChildren <Text>().text = Configs.Strings.GetString("no_thanks"); var levelState = LevelPlayground.GetLevelState(); if (levelState == LevelPlayground.LevelState.WinLevel) { Color newColor = new Color(); ColorUtility.TryParseHtmlString("#6DC248", out newColor); textResult.color = newColor; textResult.text = Configs.Strings.GetString("victory"); textBody.color = newColor; textBody.text = Configs.Strings.GetString("reward"); textPlay.text = Configs.Strings.GetString("go_on"); counterText.GetComponent <Text>().text = Configs.Balance.LevelReward.ToString(); GameData.AddedCurrency = Configs.Balance.LevelReward; Events.LaunchEvent(Events.Types.IncreaseCurrency); buttonDeny.SetActive(false); prize.SetActive(false); } else if (levelState == LevelPlayground.LevelState.LoseLevel) { Color newColor = new Color(); ColorUtility.TryParseHtmlString("#CB6176", out newColor); textResult.color = newColor; textResult.text = Configs.Strings.GetString("loss"); textBody.color = newColor; textBody.text = Configs.Strings.GetString("total"); textPlay.text = Configs.Strings.GetString("continue"); var paymentText = GameObject.Find("CounterPayment").GetComponent <Text>(); paymentText.text = Configs.Balance.PaymentForContinue.ToString(); counterText.GetComponent <Text>().text = GameData.GetCurrency().ToString(); } }
public void GoOut() { Audio.Play(); if (LevelPlayground.GetCurrentLevel() == LevelPlayground.NumberOfLevels) { Invoke("GoToResult", Audio.clip.length / 3); } else { Invoke("RestartLevel", Audio.clip.length / 3); } }
public static void RestartGame() { Scenes.ResetManager(); Configs.ResetManager(); Profile.ResetManager(); Events.ResetManager(); Sounds.ResetManager(); Server.ResetManager(); LevelPlayground.SetLevelState(LevelPlayground.LevelState.Unknown); Scenes.GoToScene(Scenes.Types.Start); Debug.Log("Game restarted"); }
public void GoToLevel() { if (LevelPlayground.GetLevelState() == LevelPlayground.LevelState.LoseLevel) { if (GameData.IsEnoughCurrency(Configs.Balance.PaymentForContinue)) { Events.LaunchEvent(Events.Types.ContinueLevelByMoney, Scenes.ActiveScene); } else { Events.LaunchEvent(Events.Types.NotEnoughMoneyToContinue, Scenes.ActiveScene); } } else { Events.LaunchEvent(Events.Types.ContinueLevel, Scenes.ActiveScene); } }
private void OnTriggerEnter2D(Collider2D other) { if (mIsFired) { return; } if (other.gameObject.name == "Wheel") { OnTriggerWheel(other.gameObject); Events.LaunchEvent(Events.Types.NextBullet, Scenes.ActiveScene); } else if (other.gameObject.name == "barrier" || other.gameObject.name == "bullet") { LevelPlayground.SetLevelState(LevelPlayground.LevelState.LoseLevel); LevelPlayground.ActiveBulletIndex = 0; OnTriggerBarrier(other.gameObject); } }
public static void OnBlockWin() { LevelPlayground.OnBlockWin(); Server.Report(Server.ReportComands.BlockFinished); }
public static void OnLevelWin() { LevelPlayground.OnLevelWin(); Server.Report(Server.ReportComands.LevelFinished); }