wip : subtitles & flash hallu

This commit is contained in:
Ferlat Thibaud
2026-05-29 17:48:08 +02:00
parent 23be332bc7
commit 5a091c80a8
16 changed files with 2825 additions and 5213 deletions
@@ -3,50 +3,43 @@ using UnityEngine;
namespace OctoCore.Localization.Editor
{
[CustomEditor(typeof(OctoLocalizedText))]
public class OctoLocalizedTextEditor : UnityEditor.Editor
{
SerializedProperty dataProp;
SerializedProperty textProp;
SerializedProperty textMeshProProp;
SerializedProperty textMeshProUGUIProp;
void OnEnable()
[CustomEditor(typeof(OctoLocalizedText))]
public class OctoLocalizedTextEditor : UnityEditor.Editor
{
dataProp = serializedObject.FindProperty("data");
textProp = serializedObject.FindProperty("text");
textMeshProProp = serializedObject.FindProperty("textMeshPro");
textMeshProUGUIProp = serializedObject.FindProperty("textMeshProUGUI");
public override void OnInspectorGUI()
{
serializedObject.Update();
OctoLocalizedText target = (OctoLocalizedText)this.target;
target.Data = (OctoLocalizedTextData)EditorGUILayout.ObjectField(
"Data",
target.Data,
typeof(OctoLocalizedTextData),
false
);
GUI.enabled = false;
SerializedProperty textProp = serializedObject.FindProperty("text");
SerializedProperty textMeshProProp = serializedObject.FindProperty("textMeshPro");
SerializedProperty textMeshProUGUIProp = serializedObject.FindProperty("textMeshProUGUI");
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 component found.", MessageType.Info);
GUI.enabled = true;
serializedObject.ApplyModifiedProperties();
if (GUI.changed)
EditorUtility.SetDirty(target);
}
}
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();
}
}
}
@@ -8,6 +8,11 @@ namespace OctoCore.Localization
public class OctoLocalizedText : MonoBehaviour
{
[SerializeField] OctoLocalizedTextData data;
public OctoLocalizedTextData Data
{
get => data;
set => data = value;
}
[SerializeField] Text text;
[SerializeField] TextMeshPro textMeshPro;
[SerializeField] TextMeshProUGUI textMeshProUGUI;
@@ -1,2 +1,15 @@
fileFormatVersion: 2
guid: 1023fdbb836c50f48bd4b52575ed3689
guid: 1023fdbb836c50f48bd4b52575ed3689
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- _data: {instanceID: 0}
- text: {instanceID: 0}
- textMeshPro: {instanceID: 0}
- textMeshProUGUI: {instanceID: 0}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: