コード例 #1
0
        static bool RestoreSessionState()
        {
            var json = SessionState.GetString(k_InMemorySceneStateSessionKey, null);

            if (string.IsNullOrEmpty(json))
            {
                return(false);
            }
            s_CurrentInMemorySceneState = InMemorySceneState.Import(json);

            s_TempFolderBase     = SessionState.GetString(k_TempFolderBaseSessionKey, Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
            registeredTempFolder = SessionState.GetBool(k_RegisteredTempFolderSessionKey, false);

            // To make sure that we don't affect future session in case something happens, we delete everything
            SessionState.EraseString(k_InMemorySceneStateSessionKey);
            SessionState.EraseString(k_TempFolderBaseSessionKey);
            SessionState.EraseBool(k_RegisteredTempFolderSessionKey);

            return(true);
        }
コード例 #2
0
 private static void ClearInMemorySceneState()
 {
     s_CurrentInMemorySceneState = InMemorySceneState.None;
 }