/// <summary> /// Adds the listener for loading finished. /// </summary> /// <remarks> /// Ensures that the object will be reactivated if without a loading system active, /// for example when playing the level in the editor out of sequence. /// </remarks> private void Awake() { if (LoadingTransitionController.Exists()) { gameObject.SetActive(false); } LoadingTransitionController.OnLoadingFinished += ActivateGameObject; }
/// <summary> /// Handles if there is no transition controller. /// </summary> private void Start() { if (!LoadingTransitionController.Exists()) { // no transition controller so disable updating. enabled = false; } }