コード例 #1
0
        public IEnumerator CheckScene(Scene scene_name)
        {
            string SceneName = scene_name.name;

            while (!scene_name.isLoaded)
            {
                yield return(new WaitForFixedUpdate());
            }
            Debug.Log("Scene Loaded: " + SceneName);
            /// Check if the identifier applys to the scene in which it was applied to.
            if (CurrentScene.name != SceneName)
            {
                WorkoutIdentifier = string.Empty;
            }

            for (int i = 0; i < YUR.Yur.Settings.StartWorkoutScenes.Length; i++)
            {
                Debug.Log("Index: " + i);
                Debug.Log("Checking Scene, array size == " + YUR.Yur.Settings.StartWorkoutScenes.Length);
                Debug.Log(" || Scene Name >>  " + YUR.Yur.Settings.StartWorkoutScenes[i]);

                if (SceneName == YUR.Yur.Settings.StartWorkoutScenes[i])
                {
                    Debug.Log("Loaded Scene is a workout scene, begin workout");
                    yield return(new WaitForFixedUpdate());

                    Workouts.Workout.StartingWorkout();
                    yield break;
                }

                Debug.Log("This scenes do not match up.");
            }


            for (int i = 0; i < YUR.Yur.Settings.EndWorkoutScenes.Length; i++)
            {
                if (SceneName == YUR.Yur.Settings.EndWorkoutScenes[i])
                {
                    yield return(new WaitForFixedUpdate());

                    Workout.EndingWorkout((string.IsNullOrEmpty(WorkoutIdentifier) ? SceneName : WorkoutIdentifier));
                    WorkoutIdentifier = string.Empty;
                    yield break;
                }
            }
            yield break;
        }
コード例 #2
0
 public void EndWorkout()
 {
     Workout.EndingWorkout(WorkoutIdentifier);
 }
コード例 #3
0
 public void EndWorkout(string identifier)
 {
     Workout.EndingWorkout(identifier);
 }