Example #1
0
    internal void Save(string saveName)
    {
        AvatarController controller = _explorationController.controllers.FirstOrDefault(a => a.character != null);

        serializeFrames();
        currentGame.currentPosition = SerializableVector3.FromVector3(controller.character.position);
        currentGame.currentRotation = SerializableVector3.FromVector3(controller.character.eulerAngles);
        currentGame.currentScene    = SceneManager.GetActiveScene().buildIndex;

        LoadSaveUtils.Save(currentGame, saveName);

        if (isPaused)
        {
            UnPauseGame();
        }
    }
Example #2
0
    internal SerializedFrame SerializeTo(SerializableGame data)
    {
        if (data == null)
        {
            return(null);
        }

        data[id] = new SerializedFrame()
        {
            id            = id,
            prefab        = prefab,
            scene         = SceneManager.GetActiveScene().buildIndex,
            destroyed     = destroyed,
            position      = SerializableVector3.FromVector3(transform.position),
            rotation      = SerializableVector3.FromVector3(transform.eulerAngles),
            componentData = SerializeComponents()
        };

        return(data[id]);
    }