Beispiel #1
0
        protected override void Awake()
        {
            base.Awake();
            this.AssertRequiredObjects(InputField, SubmitButton);

            scriptPlayer    = Engine.GetService <IScriptPlayer>();
            variableManager = Engine.GetService <ICustomVariableManager>();
            stateManager    = Engine.GetService <IStateManager>();
            submitInput     = Engine.GetService <IInputManager>().GetSubmit();

            SubmitButton.interactable = false;
        }
        public UniTask InitializeServiceAsync()
        {
            Engine.GetService <IScriptPlayer>().AddPreExecutionTask(HandleCommandPreExecution);

            rollbackInput = Engine.GetService <IInputManager>().GetRollback();

            if (rollbackInput != null)
            {
                rollbackInput.OnStart += HandleRollbackInputStart;
            }

            return(UniTask.CompletedTask);
        }
Beispiel #3
0
        private async UniTask PerformPostEngineInitializationTasks()
        {
            await LoadSettingsAsync();

            if (!Engine.Initializing)
            {
                return;
            }
            await LoadGlobalAsync();

            if (!Engine.Initializing)
            {
                return;
            }

            if (Configuration.EnableStateRollback)
            {
                InitializeRollback();
            }

            async UniTask LoadSettingsAsync()
            {
                SettingsState = await SettingsSlotManager.LoadOrDefaultAsync(Configuration.DefaultSettingsSlotId);
                await LoadAllServicesFromStateAsync <IStatefulService <SettingsStateMap>, SettingsStateMap>(SettingsState);
            }

            async UniTask LoadGlobalAsync()
            {
                GlobalState = await GlobalSlotManager.LoadOrDefaultAsync(Configuration.DefaultGlobalSlotId);
                await LoadAllServicesFromStateAsync <IStatefulService <GlobalStateMap>, GlobalStateMap>(GlobalState);
            }

            void InitializeRollback()
            {
                scriptPlayer.AddPreExecutionTask(HandleCommandPreExecution);

                rollbackInput = Engine.GetService <IInputManager>().GetRollback();
                if (rollbackInput != null)
                {
                    rollbackInput.OnStart += HandleRollbackInputStart;
                }
            }
        }
Beispiel #4
0
        public virtual async UniTask InitializeServiceAsync()
        {
            scriptPlayer  = Engine.GetService <IScriptPlayer>();
            cameraManager = Engine.GetService <ICameraManager>();

            if (Configuration.EnableStateRollback)
            {
                scriptPlayer.AddPreExecutionTask(HandleCommandPreExecution);

                rollbackInput = Engine.GetService <IInputManager>().GetRollback();
                if (rollbackInput != null)
                {
                    rollbackInput.OnStart += HandleRollbackInputStart;
                }
            }

            SettingsState = await LoadSettingsAsync();

            GlobalState = await LoadGlobalStateAsync();
        }
Beispiel #5
0
        public CameraLookController(ICameraManager cameraManager, IInputSampler xSampler, IInputSampler ySampler)
        {
            this.cameraManager = cameraManager;
            this.xSampler      = xSampler;
            this.ySampler      = ySampler;

            origin = cameraManager.Configuration.InitialPosition + cameraManager.Offset;
        }
        protected override void Awake()
        {
            base.Awake();

            pauseInput = Engine.GetService <IInputManager>()?.GetPause();
        }