Esempio n. 1
0
        protected override IEnumerator ExecuteRoutine()
        {
            if (_world is SimulationWorld simWorld && simWorld.GetLastTickIdFromEntity() != s_CachedSerializationTickId)
            {
                s_CachedSerializationOp = new SimSerializationOperation(_world);
                s_CachedSerializationOp.Execute();
                s_CachedSerializationTickId = simWorld.GetLastTickIdFromEntity();
            }

            if (s_CachedSerializationOp.IsRunning)
            {
                yield return(ExecuteSubOperationAndWaitForSuccess(s_CachedSerializationOp));
            }

            SerializationData = s_CachedSerializationOp.SerializationData;

            if (s_CachedSerializationOp.HasSucceeded)
            {
                TerminateWithSuccess(s_CachedSerializationOp.Message);
            }
            else
            {
                TerminateWithAbnormalFailure(s_CachedSerializationOp.Message);
            }
        }
Esempio n. 2
0
 static void StaticReset()
 {
     s_CachedSerializationOp     = null;
     s_CachedSerializationTickId = uint.MaxValue;
 }