Ejemplo n.º 1
0
        // parsing state data push to state deque.
        public void ParsingStateData(int timePos, string parsingData)
        {
            TinyReplayObjectState newState = this.GetUnUsedState();

            newState.ParsingProperties(this.entityIndex, timePos, parsingData);
            this.mReadyToReplayData.Enqueue(newState);
            // Debug.Log("   first time?");
        }
Ejemplo n.º 2
0
        private TinyReplayObjectState GetUnUsedState()
        {
            TinyReplayObjectState objectStateData = null;

            if (this.mActiveReplayDataStackPool.Count > 0)
            {
                objectStateData = this.mActiveReplayDataStackPool.Pop();
            }
            else
            {
                objectStateData = new TinyReplayObjectState();
            }
            return(objectStateData);
        }
Ejemplo n.º 3
0
        protected virtual void SaveReplayEntityState(int timePos)
        {
            this.mCacheState.ResetState();
            int    saveType      = this.GetChangePropertiesType();
            string saveStateData = TinyReplayObjectState.SaveCurStateProperties(this.entityIndex,
                                                                                timePos,
                                                                                mTrs,
                                                                                null,
                                                                                saveType);

            if (saveType != 0)
            {
                TinyReplayRecordController.instance.SaveDataToLocalFile(saveStateData);
            }
        }
Ejemplo n.º 4
0
        // synchronize entity state with local save file.
        public void SynchronizeEntity(int timePosition)
        {
            if (this.mReadyToReplayData.Count <= 0)
            {
                return;
            }
            TinyReplayObjectState curState = this.mReadyToReplayData.Peek();

            // if state in the deque's data timePosition is equal to timePosition just synchronize entity.
            if (curState.TimePos == timePosition)
            {
                curState = this.mReadyToReplayData.Dequeue();
                this.RealSynchronizeEntity(curState);
                this.mActiveReplayDataStackPool.Push(curState);
            }
        }
Ejemplo n.º 5
0
        protected override void SaveReplayEntityState(int timePos)
        {
            this.mCacheState.ResetState();
            int saveType = this.GetChangePropertiesType();

            if (!this.mTexture.color.Equals(this.mCacheColor))
            {
                this.mCacheColor = this.mTexture.color;
                saveType        |= (1 << (int)SaveTargetPropertiesType.Color);
            }
            string saveStateData = TinyReplayObjectState.SaveCurStateProperties(this.entityIndex,
                                                                                timePos,
                                                                                mTrs,
                                                                                this.mTexture,
                                                                                saveType);

            if (saveType != 0)
            {
                TinyReplayRecordController.instance.SaveDataToLocalFile(saveStateData);
            }
        }
Ejemplo n.º 6
0
 protected override void RealSynchronizeEntity(TinyReplayObjectState newState)
 {
     base.RealSynchronizeEntity(newState);
     newState.SynchronizeColorProperties(this.mTexture, this.mCacheColor);
 }
Ejemplo n.º 7
0
 protected virtual void RealSynchronizeEntity(TinyReplayObjectState newState)
 {
     newState.SynchronizeProperties(this.mTrs);
 }