private static void endTransversePoint() { if (isMovingPoint) { Coroutines.Stop(transversePointCoroutine); } isMovingPoint = false; }
/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */ private static void endTransversePosition() { if (isMovingPosition) { Coroutines.Stop(transversePositionCoroutine); } isMovingPosition = false; }
/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */ private static IEnumerator load_level(int currentID) { loading = true; if (currentID != -1) { yield return(SceneManager.LoadSceneAsync(currentID)); } Coroutines.Stop(coroutine); loading = false; }
/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */ public static void Switch(int sceneID) { if (currentIndex == sceneID || loading) { return; } Calendar.Enable = false; currentIndex = sceneID; coroutine = Coroutines.Start(load_level(currentIndex)); }
public static void TransversePoint(Vector3 from, Vector3 to, float speed = 1f) { endTransversePoint(); cameraObject.transform.LookAt(from); transversePointCoroutine = Coroutines.Start(transversePointAsync(from, to, Time.time, speed, Vector3.Distance(from, to))); }
public static void TransversePosition(Vector3 from, Vector3 to, float speed = 1f) { endTransversePosition(); cameraObject.transform.position = from; transversePositionCoroutine = Coroutines.Start(transversePositionAsync(from, to, Time.time, speed, Vector3.Distance(from, to))); }