// for when the player arrives on next activity, called via trigger in ActivityPlatform public void AdvanceTimeStep(ActivityPlatform newActivityPlatform) { if (newActivityPlatform != null) { // activate UI tutorial on first platform of run if (gameManager.showUITutorial) { tutorialManager.ActivateUITutorial(); } // increment timeSteps runState.timeSteps += 1; // update activity history runState.activityHistory.Add(newActivityPlatform); runState.height = newActivityPlatform.y; // make first activity "sleep in" if (newActivityPlatform.activity == null) { Debug.Assert(runState.activityHistory.Count == 1); newActivityPlatform.activity = Object.FindObjectOfType <SleepIn>(); runState.timeSteps = 0; } else { // clear out other spawnedPlatforms runState.ClearSpawned(newActivityPlatform); // trigger activity special effect newActivityPlatform.activity.Effect(runState); } // start new platform spawning rhythm notes rhythmManager.StartRhythm(newActivityPlatform.activity); // start activity animation player.GetComponent <Animator>().SetInteger("activityHash", Animator.StringToHash(newActivityPlatform.activity.name)); player.GetComponent <Animator>().SetTrigger("startActivity"); // hack special case increase energy from martial arts if (GameManager.Instance.profile.exerciseMartialArts && newActivityPlatform.activity.name == "Exercise") { runState.energy += 5; } } // return zoom to normal camera.ZoomNormal(); }