private static void HandlePropertiesChange(QGradualMovementProperties oldProperties, QGradualMovementProperties newProperties) { if (!oldProperties.dontDestroyOnLoad && newProperties.dontDestroyOnLoad) { //change to dont destroy on load. DontDestroyOnLoad(singleton); } else if (oldProperties.dontDestroyOnLoad && !newProperties.dontDestroyOnLoad) { //change to DO destroy on load. SceneManager.MoveGameObjectToScene(singleton.gameObject, SceneManager.GetActiveScene()); } }
/// <summary> /// Changes the properties that the manager is abiding by. /// </summary> /// <param name="newProperties"> the new properties struct </param> public static void ChangeProperties(QGradualMovementProperties newProperties) { HandlePropertiesChange(singleton.currentProperties, newProperties); singleton.currentProperties = newProperties; }