示例#1
0
        protected override Serializer Deserialize(Serializer serializer)
        {
            base.Deserialize(serializer);

            _lifeCycleState = serializer.GetDataItem<LifeCycleStateValue>("life-cycle-state");
            Collidable = serializer.GetDataItem<bool>("collidable");
            ReadyForDisposal = serializer.GetDataItem<bool>("ready-for-disposal");

            return serializer;
        }
示例#2
0
        private void UpdateLifeCycleState(LifeCycleStateValue newLifeCycleState)
        {
            _lifeCycleState = newLifeCycleState;

            switch (newLifeCycleState)
            {
                case LifeCycleStateValue.Active: Collidable = true; break;
                case LifeCycleStateValue.Exiting: StartExitSequence(); break;
                case LifeCycleStateValue.ReadyForRemoval: ReadyForDisposal = true; break;
            }
        }
示例#3
0
        protected override Serializer Deserialize(Serializer serializer)
        {
            base.Deserialize(serializer);

            Collidable       = serializer.GetDataItem <bool>("collidable");
            _lifeCycleState  = serializer.GetDataItem <LifeCycleStateValue>("life-cycle-state");
            ReadyForDisposal = serializer.GetDataItem <bool>("ready-for-disposal");

            if (_lifeCycleState == LifeCycleStateValue.Exiting)
            {
                Visible = false;
                UpdateLifeCycleState(LifeCycleStateValue.ReadyForRemoval);
            }

            return(serializer);
        }
示例#4
0
        protected override Serializer Deserialize(Serializer serializer)
        {
            base.Deserialize(serializer);

            _lifeCycleState = serializer.GetDataItem<LifeCycleStateValue>("life-cycle-state");
            Collidable = serializer.GetDataItem<bool>("collidable");
            ReadyForDisposal = serializer.GetDataItem<bool>("ready-for-disposal");

            return serializer;
        }
示例#5
0
        private void UpdateLifeCycleState(LifeCycleStateValue newLifeCycleState)
        {
            _lifeCycleState = newLifeCycleState;

            switch (newLifeCycleState)
            {
                case LifeCycleStateValue.Active: Collidable = true; break;
                case LifeCycleStateValue.Exiting: StartExitSequence(); break;
                case LifeCycleStateValue.ReadyForRemoval: ReadyForDisposal = true; break;
            }
        }
        protected override Serializer Deserialize(Serializer serializer)
        {
            base.Deserialize(serializer);

            Collidable = serializer.GetDataItem<bool>("collidable");
            _lifeCycleState = serializer.GetDataItem<LifeCycleStateValue>("life-cycle-state");
            ReadyForDisposal = serializer.GetDataItem<bool>("ready-for-disposal");

            if (_lifeCycleState == LifeCycleStateValue.Exiting)
            {
                Visible = false;
                UpdateLifeCycleState(LifeCycleStateValue.ReadyForRemoval);
            }

            return serializer;
        }