Skip to content

Commit 4444c33

Browse files
authored
Merge pull request #51 from AkiKurisu/dev/v0.6.2
Merge Dev v0.6.2
2 parents c541052 + 3f456d1 commit 4444c33

5 files changed

Lines changed: 15 additions & 9 deletions

File tree

Editor/Core/Editors/CeresSettings.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using Chris.Configs.Editor;
32
using Chris.Editor;
43
using Chris.Serialization;
54
using UnityEditor;
@@ -9,6 +8,7 @@
98

109
namespace Ceres.Editor
1110
{
11+
[BaseConfig]
1212
public class CeresSettings : ConfigSingleton<CeresSettings>
1313
{
1414
public enum GraphEditorDisplayMode
@@ -49,10 +49,9 @@ public enum GraphEditorDisplayMode
4949
public static void SaveSettings()
5050
{
5151
Instance.Save(true);
52-
var serializer = ConfigsEditorUtils.GetConfigSerializer();
5352
var config = CeresConfig.Get();
5453
config.logLevel = Instance.logLevel;
55-
config.Save(serializer);
54+
Serialize(config);
5655
}
5756

5857
internal static void AddPreservedType(Type type)

Editor/Flow/Editors/FlowSettings.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using System.Linq;
22
using Ceres.Graph.Flow;
3-
using Chris.Configs.Editor;
43
using Chris.Editor;
54
using UnityEditor;
65
using UnityEngine;
76
using UnityEngine.UIElements;
87

98
namespace Ceres.Editor
109
{
10+
[BaseConfig]
1111
public class FlowSettings : ConfigSingleton<FlowSettings>
1212
{
1313
private static FlowSettings _setting;
@@ -21,11 +21,10 @@ public class FlowSettings : ConfigSingleton<FlowSettings>
2121
public static void SaveSettings()
2222
{
2323
Instance.Save(true);
24-
var serializer = ConfigsEditorUtils.GetConfigSerializer();
2524
var config = FlowConfig.Get();
2625
config.logExecutableReflection = Instance.logExecutableReflection;
2726
config.alwaysIncludedAssemblyWildcards = Instance.alwaysIncludedAssemblyWildcards;
28-
config.Save(serializer);
27+
Serialize(config);
2928
}
3029
}
3130

Runtime/Core/Models/Graph/CeresGraph.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,8 +819,8 @@ protected void ReadFromLinkedNodes(CeresGraph graph)
819819
/* Must serialize node data after clear references */
820820
nodeData = nodes.Select(node => node.GetSerializedData()).ToArray();
821821
#if UNITY_EDITOR
822-
nodeGroups = graph.nodeGroups.ToArray();
823-
relayNodes = graph.relayNodes.ToArray();
822+
nodeGroups = graph.nodeGroups?.ToArray() ?? Array.Empty<NodeGroup>();
823+
relayNodes = graph.relayNodes?.ToArray() ?? Array.Empty<RelayNode>();
824824
#endif
825825
}
826826
}

Runtime/Core/Models/Graph/Variables/GlobalVariables.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ public GlobalVariables(List<SharedVariable> sharedVariables, IVariableScope pare
3636

3737
private static GlobalVariables FindOrCreateDefault()
3838
{
39+
#if UNITY_6000_0_OR_NEWER
40+
var scope = UObject.FindFirstObjectByType<SceneVariableScope>();
41+
#else
3942
var scope = UObject.FindObjectOfType<SceneVariableScope>();
43+
#endif
4044
if (scope != null)
4145
{
4246
scope.Initialize();

Runtime/Flow/Models/Libraries/UnityExecutableLibrary.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ public static void Flow_Destroy([NotNull] UObject uObject)
3737
}
3838

3939
/// <summary>
40-
/// Returns the first active loaded object of Type type.
40+
/// Retrieves the first active loaded object of Type type.
4141
/// </summary>
4242
/// <param name="type"></param>
4343
/// <returns></returns>
4444
[ExecutableFunction]
4545
public static UObject Flow_FindObjectOfType(
4646
[ResolveReturn] SerializedType<UObject> type)
4747
{
48+
#if UNITY_6000_0_OR_NEWER
49+
return UObject.FindFirstObjectByType(type);
50+
#else
4851
return UObject.FindObjectOfType(type);
52+
#endif
4953
}
5054

5155
#endregion UObject

0 commit comments

Comments
 (0)