// Start is called before the first frame update void Start() { stageNumber = sceneManager.GetStageNumber(); levelNumber = sceneManager.GetLevelNumber(); string label = "Stage" + stageNumber.ToString() + "Level" + levelNumber.ToString() + "Unlocked"; int unlockCondition = PlayerPrefs.GetInt(label); if (levelNumber == 1) { unlockCondition = 1; } if (unlockCondition != 0) { levelButton.interactable = true; buttonImage.color = Color.white; padlock.enabled = false; } else { levelButton.interactable = false; buttonImage.color = Color.gray; padlock.enabled = true; } }
private void Awake() { stageNumber = sceneManager.GetStageNumber(); levelNumber = sceneManager.GetLevelNumber(); recordedLabel = "Stage" + stageNumber + "Level" + levelNumber + "PassesRecord"; recordedPassCount = PlayerPrefs.GetInt(recordedLabel); }
private void Awake() { sceneManager = GetComponent <scenemanager_CS>(); stageNumber = sceneManager.GetStageNumber(); levelNumber = sceneManager.GetLevelNumber(); label = "Stage" + stageNumber + "Level" + levelNumber + "Passes"; passCount = PlayerPrefs.GetInt(label); }
private void Awake() { livesSystem = GameObject.FindWithTag(playerTag).GetComponent <livesSystem_CS>(); hallPassSystem = GameObject.FindWithTag(playerTag).GetComponent <hallPassSystem_CS>(); analyticsTracker = GameObject.FindWithTag(playerTag).GetComponent <analyticsTracker_CS>(); totalDist = Vector3.Distance(playerTransform.position, goalTransform.position); stageNumber = sceneManager.GetStageNumber(); levelNumber = sceneManager.GetLevelNumber(); }
private void OnTriggerEnter(Collider other) { if (other.tag == obstacleTag) { //run related script to handle player lives livesSystem.subtractLives(); //analytics int stageNumber = sceneManager.GetStageNumber(); int levelNumber = sceneManager.GetLevelNumber(); Vector3 playerPosition = this.transform.position; analyticsTracker.OnPlayerHitsObstacle(other.name, stageNumber, levelNumber, playerPosition); //play animations involved animations.PlayerGetsHit(); //script accesses the object and runs the script associated with despawning it Destroy(other.gameObject); } if (other.tag == passTag) { //run related script to handle hall passes obtained hallPassSystem.AddHallPass(); //script accesses the object and runs the script associated with despawning it fade = other.gameObject.GetComponent <fadeOut_CS>(); fade.SetBool(true); other.enabled = false; //call related UI and Particle Animations here } if (other.tag == finishLineTag) { //tells the game that the level is finished mainGameplayUI.SetBool(true); //play animations involved } if (other.tag == customItemTag) { // call related UI and Particle Animations here Debug.Log("You've obtained a HAT! Got to the customize menu to see how it looks on you."); hatAnimation = other.gameObject.GetComponent <hatAnimation_CS>(); hatAnimation.AddHat(); //script accesses the object and runs the script associated with despawning it fade = other.gameObject.GetComponent <fadeOut_CS>(); fade.SetBool(true); fade.SetPromptActive(); } }
// Start is called before the first frame update void Awake() { sceneManager = GetComponent <scenemanager_CS>(); stageNumber = sceneManager.GetStageNumber(); levelNumber = sceneManager.GetLevelNumber(); if (stageNumber == 2) { switch (levelNumber) { case 10: assetColor = colorOptions[4]; break; case 9: assetColor = colorOptions[3]; break; case 8: assetColor = colorOptions[2]; break; case 7: assetColor = colorOptions[1]; break; case 6: assetColor = colorOptions[0]; break; case 5: assetColor = colorOptions[4]; break; case 4: assetColor = colorOptions[3]; break; case 3: assetColor = colorOptions[2]; break; case 2: assetColor = colorOptions[1]; break; default: assetColor = colorOptions[0]; break; } assetMat.SetColor("_Tint", assetColor); } }