Пример #1
0
        private static void SyncFromStateAbstractComponent(AbstractStateComponent component, ICharacterState state)
        {
            var snapshots = state.GetSnapshots();

            snapshots[0].StateId            = component.PostureStateId;
            snapshots[0].StateProgress      = component.PostureStateProgress;
            snapshots[0].TransitoinId       = component.PostureTransitionId;
            snapshots[0].TransitionProgress = component.PostureTransitionProgress;
            snapshots[1].StateId            = component.LeanStateId;
            snapshots[1].StateProgress      = component.LeanStateProgress;
            snapshots[1].TransitoinId       = component.LeanTransitionId;
            snapshots[1].TransitionProgress = component.LeanTransitionProgress;
            snapshots[2].StateId            = component.MovementStateId;
            snapshots[2].StateProgress      = component.MovementStateProgress;
            snapshots[2].TransitoinId       = component.MovementTransitionId;
            snapshots[2].TransitionProgress = component.MovementTransitionProgress;
            snapshots[3].StateId            = component.ActionStateId;
            snapshots[3].StateProgress      = component.ActionStateProgress;
            snapshots[3].TransitoinId       = component.ActionTransitionId;
            snapshots[3].TransitionProgress = component.ActionTransitionProgress;
            snapshots[4].StateId            = component.KeepStateId;
            snapshots[4].StateProgress      = component.KeepStateProgress;
            snapshots[4].TransitoinId       = component.KeepTransitionId;
            snapshots[4].TransitionProgress = component.KeepTransitionProgress;
            state.TryRewind();
        }