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; }
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); }
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; }