init
This commit is contained in:
29
Assets/Editor/WI/INIEditor.cs
Normal file
29
Assets/Editor/WI/INIEditor.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using WI;
|
||||
using XED;
|
||||
|
||||
[CustomAsset(".ini")]
|
||||
|
||||
public class INIEditor : Editor
|
||||
{
|
||||
public string data;
|
||||
public string assetPath;
|
||||
static int prevHash;
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
data = EditorGUILayout.TextArea(data);
|
||||
int hash = data.GetHashCode();
|
||||
if (hash != prevHash)
|
||||
{
|
||||
File.WriteAllText(assetPath, data);
|
||||
prevHash = hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user