上下文加载优化
This commit is contained in:
Submodule Assets/Convention updated: c12d4a3754...32f0038e34
@@ -378,6 +378,7 @@ namespace Demo.Editor
|
|||||||
private void RegisterVariableGenerater()
|
private void RegisterVariableGenerater()
|
||||||
{
|
{
|
||||||
// Generate Framework
|
// Generate Framework
|
||||||
|
Debug.Log(nameof(RegisterVariableGenerater), this);
|
||||||
var generaters = DefaultInstantiate.GetScriptableObjectInstantiate();
|
var generaters = DefaultInstantiate.GetScriptableObjectInstantiate();
|
||||||
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())
|
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())
|
||||||
{
|
{
|
||||||
@@ -420,7 +421,7 @@ namespace Demo.Editor
|
|||||||
helperHeaderDir.MustExistsPath();
|
helperHeaderDir.MustExistsPath();
|
||||||
foreach (var (name, variable) in Convention.RScript.Variable.RScriptInjectVariableGenerater.AllRScriptInjectVariables)
|
foreach (var (name, variable) in Convention.RScript.Variable.RScriptInjectVariableGenerater.AllRScriptInjectVariables)
|
||||||
{
|
{
|
||||||
(helperHeaderDir | name).SaveAsText(variable.scriptIndicator);
|
(helperHeaderDir | name.Replace('<', '[').Replace('>', ']')).SaveAsText(variable.scriptIndicator);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset
|
// Reset
|
||||||
|
|||||||
@@ -175,12 +175,12 @@ namespace Demo
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ScriptableObject
|
public partial class ScriptableObject
|
||||||
{
|
{
|
||||||
public readonly Dictionary<string, float> ScriptableObjectContents = new();
|
private NativeHashMap<int, float> ScriptableObjectContents;
|
||||||
|
|
||||||
[Convention.RScript.Variable.Attr.Method]
|
[Convention.RScript.Variable.Attr.Method]
|
||||||
public float GetContent(string key)
|
public float GetContent(string key)
|
||||||
{
|
{
|
||||||
if (ScriptableObjectContents.TryGetValue(key, out var result))
|
if (ScriptableObjectContents.IsCreated && ScriptableObjectContents.TryGetValue(key.GetHashCode(), out var result))
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,11 @@ namespace Demo
|
|||||||
[Convention.RScript.Variable.Attr.Method]
|
[Convention.RScript.Variable.Attr.Method]
|
||||||
public float SetContent(string key, float value)
|
public float SetContent(string key, float value)
|
||||||
{
|
{
|
||||||
ScriptableObjectContents[key] = value;
|
if (ScriptableObjectContents.IsCreated == false)
|
||||||
|
{
|
||||||
|
ScriptableObjectContents = new(8, AllocatorManager.Persistent);
|
||||||
|
}
|
||||||
|
ScriptableObjectContents[key.GetHashCode()] = value;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -315,7 +319,12 @@ namespace Demo
|
|||||||
}
|
}
|
||||||
this.Parent = parent;
|
this.Parent = parent;
|
||||||
if (parent != null)
|
if (parent != null)
|
||||||
this.ScriptableObjectContents.AddRange(parent.ScriptableObjectContents);
|
{
|
||||||
|
foreach (var item in parent.ScriptableObjectContents)
|
||||||
|
{
|
||||||
|
this.ScriptableObjectContents[item.Key] = item.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.name = ScriptName;
|
this.name = ScriptName;
|
||||||
|
|
||||||
@@ -603,7 +612,7 @@ namespace Demo
|
|||||||
}
|
}
|
||||||
// 释放资源
|
// 释放资源
|
||||||
{
|
{
|
||||||
this.ScriptableObjectContents.Clear();
|
this.ScriptableObjectContents.Dispose();
|
||||||
}
|
}
|
||||||
IsScriptApply = true;
|
IsScriptApply = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule Assets/Scripts/Framework/[RScript] updated: 0a7f6eb362...249a2f9ce3
@@ -35,7 +35,7 @@ MonoBehaviour:
|
|||||||
- line: '| useOnDemandResources: 0'
|
- line: '| useOnDemandResources: 0'
|
||||||
- line: '| accelerometerFrequency: 60'
|
- line: '| accelerometerFrequency: 60'
|
||||||
- line: '| companyName: LiuBai'
|
- line: '| companyName: LiuBai'
|
||||||
- line: '| productName: Murmur-Resonance-Editor'
|
- line: '| productName: ScriptableObject-Editor'
|
||||||
- line: '| defaultCursor: {instanceID: 0}'
|
- line: '| defaultCursor: {instanceID: 0}'
|
||||||
- line: '| cursorHotspot: {x: 0, y: 0}'
|
- line: '| cursorHotspot: {x: 0, y: 0}'
|
||||||
- line: '| m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b:
|
- line: '| m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b:
|
||||||
@@ -165,7 +165,7 @@ MonoBehaviour:
|
|||||||
- line: '| loadStoreDebugModeEnabled: 0'
|
- line: '| loadStoreDebugModeEnabled: 0'
|
||||||
- line: '| visionOSBundleVersion: 1.0'
|
- line: '| visionOSBundleVersion: 1.0'
|
||||||
- line: '| tvOSBundleVersion: 1.0'
|
- line: '| tvOSBundleVersion: 1.0'
|
||||||
- line: '| bundleVersion: 1.0'
|
- line: '| bundleVersion: 1.1'
|
||||||
- line: '| preloadedAssets:'
|
- line: '| preloadedAssets:'
|
||||||
- line: '| - {instanceID: 0}'
|
- line: '| - {instanceID: 0}'
|
||||||
- line: '| - {instanceID: 0}'
|
- line: '| - {instanceID: 0}'
|
||||||
@@ -1139,9 +1139,9 @@ MonoBehaviour:
|
|||||||
- rid: 4324738286741356696
|
- rid: 4324738286741356696
|
||||||
type: {class: WindowsPlatformSettings, ns: UnityEditor.WindowsStandalone, asm: UnityEditor.WindowsStandalone.Extensions}
|
type: {class: WindowsPlatformSettings, ns: UnityEditor.WindowsStandalone, asm: UnityEditor.WindowsStandalone.Extensions}
|
||||||
data:
|
data:
|
||||||
m_Development: 0
|
m_Development: 1
|
||||||
m_ConnectProfiler: 0
|
m_ConnectProfiler: 0
|
||||||
m_BuildWithDeepProfilingSupport: 0
|
m_BuildWithDeepProfilingSupport: 1
|
||||||
m_AllowDebugging: 0
|
m_AllowDebugging: 0
|
||||||
m_WaitForManagedDebugger: 0
|
m_WaitForManagedDebugger: 0
|
||||||
m_ManagedDebuggerFixedPort: 0
|
m_ManagedDebuggerFixedPort: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user