46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace AlicizaX.UI.Editor
|
|
{
|
|
internal sealed class UIGenerationContext
|
|
{
|
|
public UIGenerationContext(GameObject targetObject, UIScriptGenerateData scriptGenerateData, IReadOnlyList<UIBindData> bindDatas)
|
|
{
|
|
TargetObject = targetObject;
|
|
ScriptGenerateData = scriptGenerateData;
|
|
BindDatas = bindDatas;
|
|
}
|
|
|
|
public GameObject TargetObject { get; }
|
|
|
|
public UIScriptGenerateData ScriptGenerateData { get; }
|
|
|
|
public IReadOnlyList<UIBindData> BindDatas { get; }
|
|
|
|
public string AssetPath { get; set; }
|
|
|
|
public string ClassName { get; set; }
|
|
|
|
public string FullTypeName =>
|
|
string.IsNullOrWhiteSpace(ScriptGenerateData?.NameSpace) ? ClassName : $"{ScriptGenerateData.NameSpace}.{ClassName}";
|
|
}
|
|
|
|
internal readonly struct UIGenerationValidationResult
|
|
{
|
|
private UIGenerationValidationResult(bool isValid, string message)
|
|
{
|
|
IsValid = isValid;
|
|
Message = message;
|
|
}
|
|
|
|
public bool IsValid { get; }
|
|
|
|
public string Message { get; }
|
|
|
|
public static UIGenerationValidationResult Success() => new(true, string.Empty);
|
|
|
|
public static UIGenerationValidationResult Fail(string message) => new(false, message);
|
|
}
|
|
}
|