generated from max/template-unity-project
28 lines
977 B
C#
28 lines
977 B
C#
|
using UnityEditor;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace VertexColor.ScenePartition.Editor
|
||
|
{
|
||
|
[FilePath("ScenePartition/SceneDataCache.asset", FilePathAttribute.Location.ProjectFolder)]
|
||
|
public class ScenePartitionSS : ScriptableSingleton<ScenePartitionSS>
|
||
|
{
|
||
|
public SceneDataCache SceneDataCache => sceneDataCache;
|
||
|
|
||
|
[SerializeField]
|
||
|
private SceneDataCache sceneDataCache = new SceneDataCache();
|
||
|
|
||
|
public ScenePartitionData GetScenePartitionData(ScenePartitionSO scenePartitionSO)
|
||
|
{
|
||
|
if (!sceneDataCache.TryGetValue(scenePartitionSO, out ScenePartitionData scenePartitionData))
|
||
|
{
|
||
|
scenePartitionData = new ScenePartitionData();
|
||
|
sceneDataCache.Add(scenePartitionSO, scenePartitionData);
|
||
|
}
|
||
|
|
||
|
return scenePartitionData;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
[System.Serializable]
|
||
|
public class SceneDataCache : SerializableDictionary<ScenePartitionSO, ScenePartitionData> { }
|
||
|
}
|