Вопрос, куда копать?)
Синтаксис:
Используется csharp
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
public partial class SO_Scene : ScriptableObject, ISerializationCallbackReceiver
{
public SceneAsset scene;
private bool _isError = false;
public void OnBeforeSerialize()
{
if (scene != null)
{
if (sceneName != scene.name)
{
sceneName = scene.name;
string strPath = AssetDatabase.GetAssetPath(this);
AssetDatabase.RenameAsset(strPath, sceneName);
EditorUtility.SetDirty(this);
}
_isError = false;
}
else
{
if(!_isError)
{
sceneName = string.Empty;
Debug.LogError("[ERROR] В SO " + this.name + " отсутствует сцена!");
_isError = true;
}
}
}
public void OnAfterDeserialize()
{
}
}
#endif
using UnityEngine;
using UnityEditor;
public partial class SO_Scene : ScriptableObject, ISerializationCallbackReceiver
{
public SceneAsset scene;
private bool _isError = false;
public void OnBeforeSerialize()
{
if (scene != null)
{
if (sceneName != scene.name)
{
sceneName = scene.name;
string strPath = AssetDatabase.GetAssetPath(this);
AssetDatabase.RenameAsset(strPath, sceneName);
EditorUtility.SetDirty(this);
}
_isError = false;
}
else
{
if(!_isError)
{
sceneName = string.Empty;
Debug.LogError("[ERROR] В SO " + this.name + " отсутствует сцена!");
_isError = true;
}
}
}
public void OnAfterDeserialize()
{
}
}
#endif