OctoCore 0.0.1

This commit is contained in:
Alexandre Coirier
2026-02-09 23:53:14 +01:00
parent 85bf743cba
commit 80d0faf8a7
235 changed files with 13656 additions and 32 deletions
@@ -0,0 +1,52 @@
using UnityEditor;
using UnityEngine;
namespace OctoCore.Localization.Editor
{
[CustomEditor(typeof(OctoLocalizedText))]
public class OctoLocalizedTextEditor : UnityEditor.Editor
{
SerializedProperty dataProp;
SerializedProperty textProp;
SerializedProperty textMeshProProp;
SerializedProperty textMeshProUGUIProp;
void OnEnable()
{
dataProp = serializedObject.FindProperty("data");
textProp = serializedObject.FindProperty("text");
textMeshProProp = serializedObject.FindProperty("textMeshPro");
textMeshProUGUIProp = serializedObject.FindProperty("textMeshProUGUI");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(dataProp);
GUI.enabled = false;
if (textProp.objectReferenceValue != null)
{
EditorGUILayout.PropertyField(textProp, new GUIContent("Text"));
}
else if (textMeshProProp.objectReferenceValue != null)
{
EditorGUILayout.PropertyField(textMeshProProp, new GUIContent("Text"));
}
else if (textMeshProUGUIProp.objectReferenceValue != null)
{
EditorGUILayout.PropertyField(textMeshProUGUIProp, new GUIContent("Text"));
}
else
{
EditorGUILayout.HelpBox("No text componant found.", MessageType.Info);
}
GUI.enabled = true;
serializedObject.ApplyModifiedProperties();
}
}
}