void Start() { Input.multiTouchEnabled = true; ggm = GlobalGameManager.instance; lc = GameObject.Find("LevelController").GetComponent <LevelController>(); staff = ggm.GetStaff(); Instantiate(staff, handRight.transform); PopulateSkins(); maxVelocity = ggm.GetMaxVelocity(); minVelocity = ggm.GetMinVelocity(); acceleration = ggm.GetAcceleration(); gravity = ggm.GetGravity(); jumpHeight = ggm.GetJumpHeight(); freeMovement = ggm.GetFreeMovement(); lowJumpMult = ggm.GetLowJumpMult(); fallMult = ggm.GetFallMult(); anim = this.transform.GetChild(0).GetComponent <Animator>(); Physics.gravity = new Vector3(0.0f, ggm.GetGravity(), 0.0f); // May need to turn into switch if (!freeMovement) { playerRB.constraints = RigidbodyConstraints.FreezePositionX; } // Part of PopulateSkins, have to turn off and turn on to reset the animator controller with the skins. wizardModel.SetActive(true); }
// TODO: Check which crystals are already collected and populate accordingly. void Start() { ggm = GlobalGameManager.instance; lc = GameObject.Find("LevelController").GetComponent <LevelController>(); rluiController = GameObject.Find("UI").GetComponent <RLUIController>(); pfd = GameObject.Find("GlobalGameManager/PlayFabController/PlayFabDataController").GetComponent <PlayFabData>(); completionRewards = GameObject.Find("GlobalGameManager/LevelData/Completion").GetComponent <RewardGroup>(); firstTimeRewards = GameObject.Find("GlobalGameManager/LevelData/FirstTime").GetComponent <RewardGroup>(); masteryRewards = GameObject.Find("GlobalGameManager/LevelData/Mastery").GetComponent <RewardGroup>(); levelLength = ggm.GetLevelLength(); spellMultiplier = ggm.GetSpellMultiplier(); spellMultiplierCap = ggm.GetSpellMultiplierCap(); speedMultiplierCap = ggm.GetMaxSpeedBonus(); maxSpeed = ggm.GetMaxVelocity(); scoreMarks = ggm.GetScoreMarks(); scoreCap = ggm.GetScoreCap(); freeMovement = ggm.GetFreeMovement(); levelName = ggm.GetLevelName(); if (freeMovement) { levelTime = 0; } levelPerformance = ggm.GetLevelPerformance(); if (levelPerformance == null) { levelPerformance = string.Empty; } if (levelPerformance.Contains("R")) { rluiController.OnCrystal("Red"); lc.CollectRedCrystal(); OnCrystalCollect("Red"); } if (levelPerformance.Contains("G")) { rluiController.OnCrystal("Green"); lc.CollectGreenCrystal(); OnCrystalCollect("Green"); } if (levelPerformance.Contains("B")) { rluiController.OnCrystal("Blue"); lc.CollectBlueCrystal(); OnCrystalCollect("Blue"); } StartCoroutine(GetCompletionData()); }