This commit is contained in:
2022-03-27 16:12:41 +03:00
parent 5a2680aa58
commit e7d10d256e
2 changed files with 63 additions and 5 deletions

View File

@@ -1,11 +1,11 @@
{
"ID": "a55dc3c04da4ea3744b7f1994565beac",
"TypeName": "FlaxEditor.Content.Settings.TimeSettings",
"EngineBuild": 6228,
"EngineBuild": 6331,
"Data": {
"UpdateFPS": 120.0,
"UpdateFPS": 0.0,
"PhysicsFPS": 120.0,
"DrawFPS": 120.0,
"DrawFPS": 0.0,
"TimeScale": 1.0,
"MaxUpdateDeltaTime": 0.1
}

View File

@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using FlaxEngine;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using FlaxEditor;
using FlaxEditor.Windows;
using FlaxEngine.Assertions;
using Console = Cabrito.Console;
using Stopwatch = System.Diagnostics.Stopwatch;
namespace Game
{
@@ -187,8 +190,63 @@ namespace Game
vertices = new Vector3[0];
}
[OnSerializing]
internal void OnSerializing(StreamingContext context)
{
Debug.Log("OnSerializing: " + Editor.IsPlayMode);
}
[OnSerialized]
internal void OnSerialized(StreamingContext context)
{
Debug.Log("OnSerialized: " + Editor.IsPlayMode);
}
[OnDeserializing]
internal void OnDeserializing(StreamingContext context)
{
Debug.Log("OnDeserializing: " + Editor.IsPlayMode);
}
[OnDeserialized]
internal void OnDeserialized(StreamingContext context)
{
Debug.Log("OnDeserialized: " + Editor.IsPlayMode);
}
public override void OnStart()
{
#if false
Action onScriptsReloadBegin = null;
onScriptsReloadBegin = () =>
{
Debug.Log("LoadMap ScriptsReloadEnd");
Actor worldSpawnActor = Actor.GetChild("WorldSpawn");
if (worldSpawnActor != null)
{
Debug.Log("LoadMap: removing DontSave flag");
worldSpawnActor.HideFlags &= ~HideFlags.DontSave;
}
ScriptsBuilder.ScriptsReloadBegin -= onScriptsReloadBegin;
};
ScriptsBuilder.ScriptsReloadBegin += onScriptsReloadBegin;
Action onScriptsReloadEnd = null;
onScriptsReloadEnd = () =>
{
Debug.Log("LoadMap ScriptsReloadEnd");
Actor worldSpawnActor = Actor.GetChild("WorldSpawn");
if (worldSpawnActor != null)
{
Debug.Log("LoadMap: restoring DontSave flag");
worldSpawnActor.HideFlags |= HideFlags.DontSave;
}
ScriptsBuilder.ScriptsReloadEnd -= onScriptsReloadEnd;
};
ScriptsBuilder.ScriptsReloadEnd += onScriptsReloadEnd;
#endif
Debug.Log("LoadMap");
LoadMap(false);
}
@@ -203,7 +261,7 @@ namespace Game
}
else
{
//Console.Print("Map already loaded in the scene");
Console.Print("Map already loaded in the scene");
return;
}
}