Esempio n. 1
0
    /// <summary>
    /// Save the specified info.
    /// </summary>
    /// <param name='info'>
    /// Info.
    /// </param>
    static public void Save(ViNoSaveInfo info)
    {
        info.data.m_LoadedLevelIndex = Application.loadedLevel;
        info.data.m_LoadedLevelName  = Application.loadedLevelName;

        // Serialization of Scene.
        if (ViNoSceneManager.Instance != null)
        {
            info.data.m_SceneXmlData = ViNoSceneManager.Instance.Save( );
        }

        // Serialization of VM.
        if (VM.Instance != null)
        {
            VM.SerializationInfo vmSerInfo = VM.Instance.Serialize( );
            info.data.m_NodeName            = vmSerInfo.m_NodeName;
            info.data.m_CurrentScenarioName = vmSerInfo.m_ScenarioName;
        }
        else
        {
            ViNoDebugger.LogError("SaveInfo", "VM NOT Found. Can't serialize VM Info.");
        }

        // Serialization of BGM.
        if (ISoundPlayer.Instance != null)
        {
            ISoundPlayer pl = ISoundPlayer.Instance;
//			ViNoSoundPlayer pl = ISoundPlayer.Instance as ViNoSoundPlayer;
            pl.OnSave(info.data);
        }

/*		if( ScenarioNode.Instance != null ){
 *                      info.data.m_ScenarioResourceFilePath = ScenarioNode.Instance.scenarioResourceFilePath;
 *              }
 * //*/

        // Set DateTime.
        info.data.m_Date = ViNoStringExtensions.GetDateTimeNowString();

        // Set Message.
        SystemUIEvent sys = GameObject.FindObjectOfType(typeof(SystemUIEvent)) as SystemUIEvent;
        string        str = sys.GetCurrentMessage();

        if (str.Length >= 14)
        {
            str = str.Substring(0, 14) + "...";
        }
        info.data.m_ScenarioDescription = str;
    }