public void RebuildMovables(SceneContentData currentSceneContentData, CurrentSceneManager currentSceneManager)
    {
        foreach (SceneContentData.MovableData movableData in currentSceneContentData.movablesData)
        {
            foreach (Movable movable in currentSceneManager.GetMovableObjects())
            {
                if (Helper.GetObjectLocalIdInFile(movable) == movableData.localIdInFile)
                {
                    PrepareDataForEntity(movable, delegate()
                    {
                        movable.moveSpeed = movableData.moveSpeed;
                        movable.IsMoving  = movableData.IsMoving;
                        movable.AreMovementsRestrained = movableData.AreMovementsRestrained;
                        movable.IsImmobilized          = movableData.IsImmobilized;
                        movable.IsInCinematicMode      = movableData.IsInCinematicMode;

                        movable.LastMove = new Vector3
                                               (movableData.LastMove[0],
                                               movableData.LastMove[1],
                                               movableData.LastMove[2]
                                               );

                        movable.MoveInput = new Vector3
                                                (movableData.MoveInput[0],
                                                movableData.MoveInput[1],
                                                movableData.MoveInput[2]
                                                );
                    });
                }
            }
        }
    }
        public SceneContentData(CurrentSceneManager currentSceneManager)
        {
            List <MonoBehaviour> transformSaveHolders = currentSceneManager.GetTransformSaveHolders();

            transformSaveHoldersData = new TransformSaveHolderData[transformSaveHolders.Count];
            int i = 0;

            foreach (MonoBehaviour transformSaveHolder in transformSaveHolders)
            {
                transformSaveHoldersData[i] = new TransformSaveHolderData(transformSaveHolder);
                i++;
            }

            Movable[] movables = currentSceneManager.GetMovableObjects();
            movablesData = new MovableData[movables.Length];
            i            = 0;

            foreach (Movable movable in movables)
            {
                movablesData[i] = new MovableData(movable);
                i++;
            }

            AutoMoving[] autoMovings = currentSceneManager.GetAutoMovingObjects();
            autoMovingsData = new AutoMovingData[autoMovings.Length];
            i = 0;

            foreach (AutoMoving autoMoving in autoMovings)
            {
                autoMovingsData[i] = new AutoMovingData(autoMoving);
                i++;
            }

            EnnemyController[] ennemies = currentSceneManager.GetEnnemies();
            ennemiesData = new EnnemyData[ennemies.Length];
            i            = 0;

            foreach (EnnemyController movable in ennemies)
            {
                ennemiesData[i] = new EnnemyData(movable);
                i++;
            }
        }
 public void RebuildAutoMovings(SceneContentData currentSceneContentData, CurrentSceneManager currentSceneManager)
 {
     foreach (SceneContentData.AutoMovingData autoMovingData in currentSceneContentData.autoMovingsData)
     {
         foreach (AutoMoving autoMoving in currentSceneManager.GetMovableObjects())
         {
             if (Helper.GetObjectLocalIdInFile(autoMoving) == autoMovingData.localIdInFile)
             {
                 PrepareDataForEntity(autoMoving, delegate()
                 {
                     autoMoving.averageMoveTime              = autoMovingData.averageMoveTime;
                     autoMoving.averageMoveTimeDelta         = autoMovingData.averageMoveTimeDelta;
                     autoMoving.betweenMovesAverageTimeDelta = autoMovingData.betweenMovesAverageTimeDelta;
                     autoMoving.moveDirectionType            = (AutoMoving.AutomoveDirectionType)autoMovingData.moveDirectionType;
                     autoMoving.TimeBetweenMovesCounter      = autoMovingData.TimeBetweenMovesCounter;
                     autoMoving.MoveTimeCounter              = autoMovingData.MoveTimeCounter;
                     autoMoving.CanMove = autoMovingData.CanMove;
                 });
             }
         }
     }
 }