protected override void OnAwake()
        {
            switch (storyEvent)
            {
            case StratusStory.ReaderEventType.Loaded:
                if (eventScope == StratusEvent.Scope.GameObject)
                {
                    reader.gameObject.Connect <StratusStory.LoadedEvent>(this.OnStoryLoadedEvent);
                }
                else
                {
                    StratusScene.Connect <StratusStory.LoadedEvent>(this.OnStoryLoadedEvent);
                }
                break;

            case StratusStory.ReaderEventType.Started:
                if (eventScope == StratusEvent.Scope.GameObject)
                {
                    reader.gameObject.Connect <StratusStory.StartedEvent>(this.OnStoryStartedEvent);
                }
                else
                {
                    StratusScene.Connect <StratusStory.StartedEvent>(this.OnStoryStartedEvent);
                }
                break;

            case StratusStory.ReaderEventType.Continue:
                if (eventScope == StratusEvent.Scope.GameObject)
                {
                    reader.gameObject.Connect <StratusStory.ContinueEvent>(this.OnStoryContinueEvent);
                }
                else
                {
                    StratusScene.Connect <StratusStory.ContinueEvent>(this.OnStoryContinueEvent);
                }
                break;

            case StratusStory.ReaderEventType.Ended:
                if (eventScope == StratusEvent.Scope.GameObject)
                {
                    reader.gameObject.Connect <StratusStory.EndedEvent>(this.OnStoryEndedEvent);
                }
                else
                {
                    StratusScene.Connect <StratusStory.EndedEvent>(this.OnStoryEndedEvent);
                }
                break;

            case StratusStory.ReaderEventType.SelectChoice:
                if (eventScope == StratusEvent.Scope.GameObject)
                {
                    reader.gameObject.Connect <StratusStory.SelectChoiceEvent>(this.OnSelectChoiceEvent);
                }
                else
                {
                    StratusScene.Connect <StratusStory.SelectChoiceEvent>(this.OnSelectChoiceEvent);
                }
                break;
            }
        }
Esempio n. 2
0
 protected override void OnWindowAwake()
 {
     lines         = new StratusCircularBuffer <string>(lineCapacity);
     stringBuilder = new StringBuilder();
     StratusScene.Connect <AddLineEvent>(OnAddLineEvent);
     OnLogWindowAwake();
 }
Esempio n. 3
0
 //------------------------------------------------------------------------------------------/
 // Messages
 //------------------------------------------------------------------------------------------/
 /// <summary>
 /// Initializes the script
 /// </summary>
 private void Start()
 {
     StratusScene.Connect <StratusStory.StartedEvent>(this.OnStoryStartedEvent);
     StratusScene.Connect <StratusStory.EndedEvent>(this.OnStoryEndedEvent);
     StratusScene.Connect <StratusStory.UpdateLineEvent>(this.OnStoryUpdateEvent);
     StratusScene.Connect <StratusStory.PresentChoicesEvent>(this.OnStoryPresentChoicesEvent);
     OnStoryDisplayStart();
 }
Esempio n. 4
0
        //------------------------------------------------------------------------/
        // Messages
        //------------------------------------------------------------------------/
        protected override void OnWindowAwake()
        {
            transitions = new Queue <TransitionAction>();
            HideLoadingScreen();
            HideOptions();

            StratusScene.Connect <FadeEvent>(this.OnCrossFadeEvent);
            StratusScene.Connect <LoadingScreenEvent>(this.OnLoadingScreenEvent);
            StratusScene.Connect <MenuOptionsEvent>(this.OnMenuOptionsEvent);
        }
 //------------------------------------------------------------------------/
 // Messages
 //------------------------------------------------------------------------/
 protected override void OnAwake()
 {
     if (eventType == StratusSegmentBehaviour.EventType.Enter)
     {
         StratusScene.Connect <StratusSegmentBehaviour.EnteredEvent>(this.OnSegmentEnteredEvent);
     }
     else if (eventType == StratusSegmentBehaviour.EventType.Exit)
     {
         StratusScene.Connect <StratusSegmentBehaviour.ExitedEvent>(this.OnSegmentExitedEvent);
     }
 }
        //------------------------------------------------------------------------------------------/
        // Events
        //------------------------------------------------------------------------------------------/
        /// <summary>
        /// Connect to common events
        /// </summary>
        void Subscribe()
        {
            this.gameObject.Connect <StratusStory.LoadEvent>(this.OnLoadEvent);

            if (listeningToScene)
            {
                StratusScene.Connect <StratusStory.LoadEvent>(this.OnLoadEvent);
            }

            this.gameObject.Connect <StratusStory.ContinueEvent>(this.OnContinueEvent);
            this.gameObject.Connect <StratusStory.SelectChoiceEvent>(this.OnSelectChoiceEvent);
            this.gameObject.Connect <StratusStory.RetrieveVariableValueEvent>(this.OnRetrieveVariableValueEvent);
            this.gameObject.Connect <StratusStory.SetVariableValueEvent>(this.OnSetVariableValueEvent);
            this.gameObject.Connect <StratusStory.ObserveVariableEvent>(this.OnObserveVariableEvent);
            this.gameObject.Connect <StratusStory.ObserveVariablesEvent>(this.OnObserveVariablesEvent);
            this.gameObject.Connect <StratusStory.RemoveVariableObserverEvent>(this.OnRemoveVariableObserverEvent);
        }
Esempio n. 7
0
 //------------------------------------------------------------------------/
 // Messages
 //------------------------------------------------------------------------/
 protected override void OnWindowAwake()
 {
     StratusScene.Connect <StratusDialogConfirmationRequest>(this.OnStratusDialogConfirmationRequest);
 }
 //------------------------------------------------------------------------/
 // Methods
 //------------------------------------------------------------------------/
 /// <summary>
 /// Subscribe to events.
 /// </summary>
 protected virtual void Subscribe()
 {
     StratusScene.Connect <StratusCombatController.SpawnEvent>(this.OnCombatControllerSpawnEvent);
     StratusScene.Connect <StratusCombatController.DeactivateEvent>(this.OnCombatControllerDeathEvent);
     StratusScene.Connect <RetryEvent>(this.OnCombatRetryEvent);
 }
Esempio n. 9
0
 //------------------------------------------------------------------------/
 // Messages
 //------------------------------------------------------------------------/
 /// <summary>
 /// Initializes the CameraTransition component.
 /// </summary>
 protected override void OnAwake()
 {
     StratusScene.Connect <TransitionEvent>(this.OnTransitionEvent);
 }
Esempio n. 10
0
 //--------------------------------------------------------------------------/
 // Procedures
 //--------------------------------------------------------------------------/
 private void Subscribe()
 {
     // Connect a member function to the given event for this GameObject or the Scene
     this.gameObject.Connect <SampleEvent>(this.OnSampleEvent);
     StratusScene.Connect <SampleEvent>(this.OnSampleEvent);
 }
Esempio n. 11
0
 protected override void OnAwake()
 {
     Player      = this.gameObject.GetComponent <AudioSource>();
     Player.loop = false;
     StratusScene.Connect <PlayEvent>(this.OnPlayEvent);
 }
 //------------------------------------------------------------------------/
 // Messages
 //------------------------------------------------------------------------/
 private void Awake()
 {
     textObjectPool       = new StratusBehaviourPool <TextMeshPro, StratusPopUpTransformText>(this.transform, textComponentPrefab, OnInstantiate);
     textObjectPool.debug = debug;
     StratusScene.Connect <StratusPopUpTransformText.InstantiateEvent>(this.OnPopUpTextInstantiateEvent);
 }