/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Tutorial2 game = new Tutorial2()) { game.Run(); } }
void Start() { completedCoolTime = false; coolTimeImage.fillAmount = 0; VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>(); if (variableLoader.useGoogleSheets) { //limit = (int) variableLoader.TrashCanStats["TrashLimit"]; totalCoolTime = variableLoader.TrashCanStats["Cooldown"]; healValue = variableLoader.TrashCanStats["AmountCollected"]; } /////////// Upgrades - Trash Spawn Rate Improved /////////// int level = ServiceLocator.Get <GameManager>().upgradeLevelsDictionary[UpgradeMenu.Upgrade.TrashSpawnRate]; UpgradesIdentifier upgradesIdentifier = ModelManager.UpgradesModel.GetUpgradeEnum(UpgradeMenu.Upgrade.TrashSpawnRate, level); coolTimeBeforeUpgrade = totalCoolTime; if (level >= 1) { totalCoolTime -= ModelManager.UpgradesModel.GetRecord(upgradesIdentifier).ModifierValue; coolTimeAfterUpgrade = totalCoolTime; } tutorial2 = GameObject.FindObjectOfType <Tutorial2>()?.GetComponent <Tutorial2>(); }
// sets next tutorial if possible, else finish public void SetNextTutorial(int currentOrder) { currentTutorial = GetTutorialByOrder(currentOrder); if (!currentTutorial) { CompletedAllTutorials(); SetNextTutorial(0); } ExpText.text = Settings.MenuManager.LangManager.getString("VM0" + currentOrder + ""); }
public void PlaceBarricade() { _CanBePickedUp = false; transform.parent = null; isPlaced = true; GetComponent <NavMeshObstacle>().enabled = true; GetComponent <NavMeshObstacle>().carving = true; Tutorial2 tutorial2 = GameObject.FindObjectOfType <Tutorial2>(); if (tutorial2) { tutorial2.barricadePlaced = true; } StartCoroutine(characterSound.BarricadeSound(0)); }
private void Awake() { if (!PlayerPrefs.HasKey("VIBRATION")) { PlayerPrefs.SetInt("VIBRATION", 1); VibrationButton.GetComponent <Image>().sprite = on; } else { if (PlayerPrefs.GetInt("VIBRATION") == 1) { VibrationButton.GetComponent <Image>().sprite = on; } else { VibrationButton.GetComponent <Image>().sprite = off; } } currentLevel = PlayerPrefs.GetInt("LevelId"); LevelText.text = "Level " + currentLevel; if (PlayerPrefs.GetInt("FromMenu") == 1) { PlayerPrefs.SetInt("FromMenu", 0); } else { isGameStarted = true; switch (currentLevel) { case 2: Tutorial2.SetActive(true); break; case 3: Tutorial3.SetActive(true); break; default: break; } TapToStartButton.gameObject.SetActive(false); } }
public void TapToStartButtonClick() { isGameStarted = true; switch (currentLevel) { case 1: Tutorial1.SetActive(true); break; case 2: Tutorial2.SetActive(true); break; case 3: Tutorial3.SetActive(true); break; default: break; } }
private void Start() { uiManager = ServiceLocator.Get <UIManager>(); VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>(); if (variableLoader.useGoogleSheets) { MaxHealth = variableLoader.TowerStats["Health"]; towerHealCostValue = variableLoader.TowerStats["PlayerHeal"]; towerLostCostValue = variableLoader.TowerStats["TrashCost"]; fullHealth = MaxHealth; } /////////// Upgrades - Improved healing /////////// int level = ServiceLocator.Get <GameManager>().upgradeLevelsDictionary[UpgradeMenu.Upgrade.ImprovedHealing]; UpgradesIdentifier upgradesIdentifier = ModelManager.UpgradesModel.GetUpgradeEnum(UpgradeMenu.Upgrade.ImprovedHealing, level); towerHealBeforeUpgrade = towerHealCostValue; if (level >= 1) { towerHealCostValue += ModelManager.UpgradesModel.GetRecord(upgradesIdentifier).ModifierValue; towerHealAfterUpgrade = towerHealCostValue; } fullHealth = ServiceLocator.Get <GameManager>()._houseHP; /////////// Upgrades - Long Ranged Upgrade /////////// int rangedLevel = ServiceLocator.Get <GameManager>().upgradeLevelsDictionary[UpgradeMenu.Upgrade.Ranged] - 1; upgradesIdentifier = ModelManager.UpgradesModel.GetUpgradeEnum(UpgradeMenu.Upgrade.Ranged, rangedLevel + 1); rangeBeforeUpgrade = range; if (rangedLevel >= 0 && gameObject.CompareTag("Tower")) { range += ModelManager.UpgradesModel.GetRecord(upgradesIdentifier).ModifierValue;// upgradeStats.towerRange[rangedLevel]; rangeAfterUpgrade = range; } tutorial2 = FindObjectOfType <Tutorial2>()?.GetComponent <Tutorial2>(); hapticFeedback = GetComponent <HapticFeedback>(); animatorHealthSignifier = signifierGO != null?signifierGO.GetComponent <Animator>() : null; }
private void Update() { if (isGameEnd || !isGameStarted) { return; } if (cubeManager.CubesWillBeDestroyed.Count == 0) { isGameEnd = true; cubeManager.ColorAllCubes(); switch (currentLevel) { case 1: Tutorial1.SetActive(false); break; case 2: Tutorial2.SetActive(false); break; case 3: Tutorial3.SetActive(false); break; default: break; } StartCoroutine(WaitAndGameWin()); Debug.Log("<color=green/>Game Win</color>"); } else if (live <= 0) { isGameEnd = true; switch (currentLevel) { case 1: Tutorial1.SetActive(false); break; case 2: Tutorial2.SetActive(false); break; case 3: Tutorial3.SetActive(false); break; default: break; } StartCoroutine(WaitAndGameLose()); } if (Input.GetMouseButton(0)) { if (ContinueTutorial.activeSelf) { counter = 0; ContinueTutorial.SetActive(false); } } else { counter += Time.deltaTime; if (counter >= 5f) { if (!ContinueTutorial.activeSelf) { ContinueTutorial.SetActive(true); } } } }