Files
Cielonos/Packages/com.lunawolfstudios.scriptablesheets/Editor/Modules/Tables/TableProperties/AssetPathTableProperty.cs
SoulliesOfficial 7ee2894a63 整合SLSUtilities
2026-01-17 11:35:49 -05:00

67 lines
1.5 KiB
C#

using UnityEngine;
namespace LunaWolfStudiosEditor.ScriptableSheets.Tables
{
public struct AssetPathTableProperty : ITableProperty
{
private static readonly string s_PropertyName = $"k_{nameof(AssetPathTableProperty)}";
private readonly Object m_RootObject;
public Object RootObject => m_RootObject;
private readonly string m_PropertyPath;
public string PropertyPath => m_PropertyPath;
private readonly string m_ControlName;
public string ControlName => m_ControlName;
private readonly string m_AssetPath;
public string AssetPath => m_AssetPath;
public AssetPathTableProperty(Object rootObject, string assetPath, string controlName)
{
m_RootObject = rootObject;
m_PropertyPath = s_PropertyName;
m_ControlName = controlName;
m_AssetPath = assetPath;
}
public void AddNewLine()
{
Debug.LogWarning($"Cannot add new lines to {nameof(ITableProperty)} {nameof(AssetPathTableProperty)}!");
return;
}
public string GetProperty()
{
return m_AssetPath;
}
public string GetProperty(FlatFileFormatSettings formatSettings)
{
return GetProperty();
}
public void SetProperty(string value, FlatFileFormatSettings formatSettings)
{
// Cannot change asset path property.
return;
}
public bool IsInputFieldProperty(bool isScriptableObject)
{
return false;
}
public bool IsUnityLocalizationProperty()
{
return false;
}
public bool NeedsSelectionBorder(bool lockNames = false)
{
return true;
}
}
}