Exemple #1
0
        protected override void SerializeState(GameStateMap stateMap)
        {
            base.SerializeState(stateMap);
            var state = new GameState {
                Messages = messages.TakeLast(SaveCapacity).Select(m => m.GetState()).ToList()
            };

            stateMap.SetState(state);
        }
        private void SerializeState(GameStateMap stateMap)
        {
            var state = new GameState()
            {
                RemoveAllButtonsPending = removeAllButtonsPending,
                Buttons = choiceButtons.Select(b => b.ChoiceState).ToList()
            };

            stateMap.SetState(state, name);
        }
        private Task SerializeState(GameStateMap stateMap)
        {
            var state = new GameState()
            {
                RemoveAllButtonsPending = removeAllButtonsPending
            };

            stateMap.SetState(state, name);
            return(Task.CompletedTask);
        }
Exemple #4
0
 protected virtual void SerializeState(GameStateMap stateMap)
 {
     if (SaveVisibilityState)
     {
         var state = new GameState {
             Visible = Visible
         };
         stateMap.SetState(state, name);
     }
 }
Exemple #5
0
        protected override void SerializeState(GameStateMap stateMap)
        {
            base.SerializeState(stateMap);

            var state = new GameState {
                RemoveAllButtonsPending = removeAllButtonsPending,
                Buttons = choiceButtons.Select(b => b.ChoiceState).ToList()
            };

            stateMap.SetState(state, name);
        }
Exemple #6
0
        protected override void SerializeState(GameStateMap stateMap)
        {
            base.SerializeState(stateMap);

            var state = new GameState()
            {
                CurrentDate = varMan.GetVariableValue(date)
            };

            stateMap.SetState(state);
        }
        protected override async Task SerializeState(GameStateMap stateMap)
        {
            await base.SerializeState(stateMap);

            var state = new GameState()
            {
                Messages = messageStack.Take(saveCapacity).Select(m => m.GetState()).Reverse().ToList()
            };

            stateMap.SetState(state);
        }
        protected virtual void SerializeState(GameStateMap stateMap)
        {
            var state = new GameState()
            {
                Visible         = Visible,
                HideOnClick     = hideOnClick,
                AllowedSamplers = allowedSamplers
            };

            stateMap.SetState(state, name);
        }
Exemple #9
0
 protected virtual Task SerializeState(GameStateMap stateMap)
 {
     if (saveVisibilityState)
     {
         var state = new GameState()
         {
             IsVisible = IsVisible
         };
         stateMap.SetState(state, name);
     }
     return(Task.CompletedTask);
 }
Exemple #10
0
        protected override void SerializeState(GameStateMap stateMap)
        {
            base.SerializeState(stateMap);

            var state = new GameState {
                VariableName   = variableName,
                SummaryText    = summaryText.text,
                InputFieldText = inputField.text,
                PlayOnSubmit   = playOnSubmit
            };

            stateMap.SetState(state);
        }
Exemple #11
0
        protected override void SerializeState(GameStateMap stateMap)
        {
            // Invoked when the game is saved.

            base.SerializeState(stateMap);

            // Serialize UI state.
            var state = new GameState {
                Position = content.transform.position,
                Slots    = grid.InventorySlots.Select(s => s.GetSate()).ToArray()
            };

            stateMap.SetState(state);
        }