Project_WL/AgentScripts/WL814d_MakeAsset.cs

35 lines
1.5 KiB
C#
Raw Normal View History

// WL-814d — WLLookModeSettings.asset 생성(C# 기본값 그대로 · 필드 누락 0).
// unity command run_script --file AgentScripts/WL814d_MakeAsset.cs --entry WL814d_MakeAsset.Run --project-path E:\NerdNavis\WL_wt\ui
// 🔴 게임 코드 아님(Assets 밖 도구). 손으로 YAML 을 쓰면 필드가 조용히 빠진다(811o 교훈).
using System.IO;
using UnityEditor;
using UnityEngine;
using WL.Look.Toggle;
public static class WL814d_MakeAsset
{
const string kDir = "Assets/WL/Look/Toggle/Resources/WL";
const string kPath = kDir + "/WLLookModeSettings.asset";
public static string Run()
{
Directory.CreateDirectory(Path.Combine(Directory.GetParent(Application.dataPath).FullName, kDir));
AssetDatabase.Refresh();
var existing = AssetDatabase.LoadAssetAtPath<WLLookModeSettings>(kPath);
if (existing != null) return "이미 있음 — " + kPath + " · 모드 " + existing.ModeCount;
var so = ScriptableObject.CreateInstance<WLLookModeSettings>();
AssetDatabase.CreateAsset(so, kPath);
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
WLLookModeSettings.ClearCache();
var loaded = Resources.Load<WLLookModeSettings>(WLLookModeSettings.ResourcesPath);
return "생성 " + kPath + " · Resources 로드=" + (loaded != null) +
" · 모드 " + (loaded != null ? loaded.ModeCount : 0) +
" · guid " + AssetDatabase.AssetPathToGUID(kPath);
}
}