Insanely huge initial commit

This commit is contained in:
2026-02-21 17:04:05 -08:00
parent 9cdd36191a
commit 613d75914a
22525 changed files with 4035207 additions and 0 deletions

View File

@@ -0,0 +1,150 @@
using System;
using Febucci.UI.Core;
using UnityEditor;
using UnityEngine;
namespace Febucci.UI
{
public class AboutWindow : EditorWindow
{
const string currentVersion = "1.3.3";
#region Utilties
const string menuParent = "Tools/Febucci/TextAnimator/";
const string linksCategory = "Links/";
const string utilsCategory = "Utils/";
const string page_docs_name = "📄 Documentation";
const string page_docs_url = "https://www.febucci.com/text-animator-unity/docs/";
const string page_roadmap_name = "📅 Roadmap";
const string page_roadmap_url = "https://www.febucci.com/text-animator-unity/roadmap/";
const string page_changelog_name = "📝 Patch Notes";
const string page_changelog_url = "https://www.febucci.com/text-animator-unity/changelog/";
const string page_support_name = "🆘 Support";
const string page_support_url = "https://www.febucci.com/text-animator-unity/support/";
[MenuItem(menuParent + utilsCategory + "Locate Global Data", false, 0)]
static void LocateGlobalData()
{
var foundData = Resources.Load(TAnimGlobalDataScriptable.resourcesPath);
if (foundData != null)
{
Selection.activeObject = foundData;
}
else
{
Debug.LogWarning(
$"Text Animator: No Scriptable data found, please create one in path {TAnimGlobalDataScriptable.resourcesPath}");
}
}
#endregion
const int windowWidth = 350;
const int windowHeight = 485;
[InitializeOnLoadMethod]
private static void FirstSetup()
{
EditorApplication.delayCall += TryOpeningWindow;
}
private static void TryOpeningWindow()
{
const string key_installedVersion = "Febucci.UI.TextAnimator.Version";
string installedVersion = PlayerPrefs.GetString(key_installedVersion);
// Same version already exists
if (!string.IsNullOrWhiteSpace(installedVersion) && currentVersion == installedVersion)
return;
PlayerPrefs.SetString(key_installedVersion, currentVersion);
OpenWindow();
}
GUIContent logo;
void OnEnable()
{
var obj = EditorGUIUtility.Load(
"Assets/Plugins/Febucci/Text Animator/Scripts/Editor/febucci.tanimator.about_logo.png");
if (obj != null)
logo = new GUIContent(obj as Texture2D);
}
GUIStyle style_rightAligned;
public void OnGUI()
{
var rect = new Rect(5, 10, windowWidth - 10, windowHeight);
GUILayout.BeginArea(rect);
//Logo, if present
if (logo != null) GUILayout.Label(logo, EditorStyles.centeredGreyMiniLabel, GUILayout.MaxHeight(180));
GUILayout.Label("Welcome!", EditorStyles.boldLabel);
GUILayout.Label("Thank you for using Text Animator. Have fun bringing your project's texts to life!",
EditorStyles.wordWrappedLabel);
if (style_rightAligned == null)
{
style_rightAligned = new GUIStyle(EditorStyles.centeredGreyMiniLabel);
style_rightAligned.alignment = TextAnchor.MiddleRight;
}
GUILayout.Label($"Version: {currentVersion}", style_rightAligned);
GUILayout.Space(5);
//--Online Resources--
GUILayout.Label("Online Resources", EditorStyles.boldLabel);
GUILayout.Label("Here are some useful resources:",
EditorStyles.wordWrappedLabel);
GUILayout.BeginHorizontal();
//Docs
if (GUILayout.Button(page_docs_name)) Application.OpenURL(page_docs_url);
//Support
if (GUILayout.Button(page_support_name)) Application.OpenURL(page_support_url);
//Patch notes
if (GUILayout.Button(page_changelog_name)) Application.OpenURL(page_changelog_url);
//Roadmap
if (GUILayout.Button(page_roadmap_name)) Application.OpenURL(page_roadmap_url);
GUILayout.EndHorizontal();
GUILayout.Space(5);
//--Extras--
GUILayout.Label("Extras", EditorStyles.boldLabel);
GUILayout.Label("Would you like to be included in a future Text Animator showcase?",
EditorStyles.wordWrappedMiniLabel);
if (GUILayout.Button("-> Submit your game/project"))
Application.OpenURL("https://www.febucci.com/text-animator-unity/showcase/");
GUILayout.Space(1);
GUILayout.Label("Please consider writing a review for the asset. It takes one minute but it really helps. Thanks!",
EditorStyles.wordWrappedMiniLabel);
if (GUILayout.Button("♥ Review on the Asset Store"))
Application.OpenURL("https://assetstore.unity.com/packages/slug/158707");
GUILayout.Space(5);
GUILayout.Label("Cheers! @febucci", EditorStyles.centeredGreyMiniLabel);
GUILayout.EndArea();
}
[MenuItem("Tools/Febucci/TextAnimator/About", priority = 0)]
private static void OpenWindow()
{
var position = new Rect(100, 100, windowWidth, windowHeight);
GetWindowWithRect<AboutWindow>(position, true, "About Text Animator", true);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e1f30d900b20e8c40b52e4fb59726f6a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 001402f99874ca24780daf2947cf5e14
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,66 @@
using UnityEngine;
using UnityEditor;
namespace Febucci.Attributes
{
[CustomPropertyDrawer(typeof(CharsDisplayTimeAttribute))]
public class CharsDisplayTimeAttributeDrawer : PropertyDrawer
{
const float minWaitTime = 0.0001f;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
//delay in seconds
Rect delayValueRect = new Rect(position.x, position.y, 70 + 230 - position.x, position.height);
delayValueRect.width = Mathf.Clamp(position.width * 0.6f, 170, position.width);
Rect delayLabel = new Rect(delayValueRect);
delayLabel.x += delayLabel.width - 15;
delayLabel.width = 77;
Rect charPerSecValueRect = new Rect(delayLabel);
charPerSecValueRect.x += charPerSecValueRect.width - 15;
charPerSecValueRect.width = 65;
Rect charPerSecLabelRect = new Rect(charPerSecValueRect);
charPerSecLabelRect.x += charPerSecLabelRect.width - 15;
charPerSecLabelRect.width = 120;
switch (property.propertyType)
{
case SerializedPropertyType.Float:
property.floatValue = EditorGUI.FloatField(delayValueRect, label, property.floatValue);
EditorGUI.LabelField(delayLabel, $"s delay, ≈");
int charPerSecond = Mathf.RoundToInt(1 / property.floatValue);
EditorGUI.LabelField(charPerSecLabelRect, "chars per sec");
EditorGUI.BeginChangeCheck();
charPerSecond = EditorGUI.IntField(charPerSecValueRect, charPerSecond);
if (EditorGUI.EndChangeCheck())
{
property.floatValue = 1f/charPerSecond;
}
if (property.floatValue < minWaitTime)
property.floatValue = minWaitTime;
break;
default: //unsupported, fallback to the default OnGUI
EditorGUI.PropertyField(position, property, label);
return;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 06ce1d00801daba44918ac07070012a3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,30 @@
using UnityEngine;
using UnityEditor;
namespace Febucci.Attributes
{
[CustomPropertyDrawer(typeof(MinValueAttribute))]
public class MinValueAttributeDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.PropertyField(position, property, label);
switch (property.propertyType)
{
case SerializedPropertyType.Integer:
property.intValue = Mathf.Clamp(property.intValue, (int)(attribute as MinValueAttribute).min, int.MaxValue);
break;
case SerializedPropertyType.Float:
property.floatValue = Mathf.Clamp(property.floatValue, (attribute as MinValueAttribute).min, float.MaxValue);
break;
default:
base.OnGUI(position, property, label);
break;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d6969374730fb584ea155e370491caf1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,49 @@
using UnityEngine;
using UnityEditor;
namespace Febucci.Attributes
{
[CustomPropertyDrawer(typeof(NotZeroAttribute))]
public class NotZeroAttributeDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
switch (property.propertyType)
{
case SerializedPropertyType.Integer:
int intValue = property.intValue;
intValue = EditorGUI.IntField(position, label, intValue);
if (intValue != 0)
property.intValue = intValue;
break;
case SerializedPropertyType.Float:
float floatValue = property.floatValue;
floatValue = EditorGUI.FloatField(position, label, floatValue);
if (floatValue != 0)
property.floatValue = floatValue;
break;
case SerializedPropertyType.Vector2:
Vector2 vecValue = property.vector2Value;
vecValue = EditorGUI.Vector2Field(position, label, vecValue);
property.vector2Value = new Vector2(
(vecValue.x != 0 || vecValue.y!=0) ? vecValue.x : property.vector2Value.x,
(vecValue.y != 0 || vecValue.x!=0) ? vecValue.y : property.vector2Value.y);
break;
default:
base.OnGUI(position, property, label);
break;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 319c5abbdd9c94e479d7c58013da0a7a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
using UnityEngine;
using UnityEditor;
namespace Febucci.Attributes
{
[CustomPropertyDrawer(typeof(PositiveValueAttribute))]
public class PositiveValueAttributeDrawer : PropertyDrawer
{
const float minValue = .01f;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
switch (property.propertyType)
{
case SerializedPropertyType.Integer:
int intValue = property.intValue;
intValue = EditorGUI.IntField(position, label, intValue);
if (intValue >= minValue)
property.intValue = intValue;
break;
case SerializedPropertyType.Float:
float floatValue = property.floatValue;
floatValue = EditorGUI.FloatField(position, label, floatValue);
property.floatValue = Mathf.Clamp(floatValue, minValue, floatValue);
break;
case SerializedPropertyType.Vector2:
Vector2 vecValue = property.vector2Value;
vecValue = EditorGUI.Vector2Field(position, label, vecValue);
vecValue.x = Mathf.Clamp(vecValue.x, minValue, vecValue.x);
vecValue.y = Mathf.Clamp(vecValue.y, minValue, vecValue.y);
property.vector2Value = vecValue;
break;
default:
base.OnGUI(position, property, label);
break;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f9574f1311c20a8418059bbedf619737
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,59 @@
using UnityEditor;
using UnityEngine;
namespace Febucci.UI.Core.Editors
{
abstract class BuiltinDataScriptableDrawer : Editor
{
SerializedProperty scriptable;
TextAnimatorDrawer.BuiltinVariablesDrawer effectsDrawer;
protected virtual void OnEnable()
{
scriptable = serializedObject.FindProperty("effectValues");
effectsDrawer = InitializeDrawer(scriptable);
}
protected abstract TextAnimatorDrawer.BuiltinVariablesDrawer InitializeDrawer(SerializedProperty property);
public override void OnInspectorGUI()
{
EditorGUILayout.LabelField("Editing shared built-in values", EditorStyles.boldLabel);
GUI.enabled = false;
EditorGUILayout.LabelField("TextAnimators that reference this asset will use and share these built-in effect values.", EditorStyles.wordWrappedLabel);
GUI.enabled = true;
if (Application.isPlaying)
{
EditorGUILayout.LabelField("[!] Remember: Changes will be saved when you exit playmode (since you are editing a Scriptable Object).", EditorStyles.wordWrappedLabel);
}
EditorGUILayout.Space();
effectsDrawer.DrawBody();
if (serializedObject.hasModifiedProperties)
serializedObject.ApplyModifiedProperties();
}
}
[CustomEditor(typeof(BuiltinAppearancesDataScriptable))]
class BuiltinAppearancesDrawer : BuiltinDataScriptableDrawer
{
protected override TextAnimatorDrawer.BuiltinVariablesDrawer InitializeDrawer(SerializedProperty property)
{
return new TextAnimatorDrawer.AppearanceDefaultEffects(property);
}
}
[CustomEditor(typeof(BuiltinBehaviorsDataScriptable))]
class BuiltinBehaviorsDrawer : BuiltinDataScriptableDrawer
{
protected override TextAnimatorDrawer.BuiltinVariablesDrawer InitializeDrawer(SerializedProperty property)
{
return new TextAnimatorDrawer.BehaviorDefaultEffects(property);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4bc56c85b1a31164e882102be0e50509
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,17 @@
{
"name": "Febucci.TextAnimator.Editor",
"references": [
"Febucci.TextAnimator.Runtime",
"Unity.TextMeshPro"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0306e69412d8fbf41a94465bbaf34341
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,129 @@
using UnityEditor;
using UnityEngine;
namespace Febucci.UI.Core.Editors
{
#if UNITY_EDITOR
[CustomEditor(typeof(TAnimGlobalDataScriptable))]
class TAnimGlobalDataScriptableDrawer : Editor
{
TAnimGlobalDataScriptable script;
SerializedProperty behaviorPresets;
SerializedProperty appearancesPresets;
SerializedProperty customActionsArray;
SerializedProperty customTagsFormatting;
SerializedProperty tagInfo_behaviors;
SerializedProperty tagInfo_appearances;
TextAnimatorDrawer.UserPresetDrawer[] behaviorDrawers = new TextAnimatorDrawer.UserPresetDrawer[0];
TextAnimatorDrawer.UserPresetDrawer[] appearancesDrawers = new TextAnimatorDrawer.UserPresetDrawer[0];
protected virtual void OnEnable()
{
behaviorPresets = serializedObject.FindProperty("globalBehaviorPresets");
appearancesPresets = serializedObject.FindProperty("globalAppearancePresets");
customActionsArray = serializedObject.FindProperty("customActions");
tagInfo_behaviors = serializedObject.FindProperty("tagInfo_behaviors");
tagInfo_appearances = serializedObject.FindProperty("tagInfo_appearances");
customTagsFormatting = serializedObject.FindProperty("customTagsFormatting");
script = (TAnimGlobalDataScriptable)target;
Undo.undoRedoPerformed += Redo;
}
private void OnDisable()
{
Undo.undoRedoPerformed -= Redo;
}
void Redo()
{
serializedObject.UpdateIfRequiredOrScript(); //I have spent too much searching this method... :(
Repaint();
TryResettingTextAnimators();
}
bool showBehaviors = false;
bool showAppearances = false;
public override void OnInspectorGUI()
{
if (Application.isPlaying)
EditorGUILayout.LabelField($"[!!] Remember: Saves are applied in play mode.");
{
EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Effects", EditorStyles.boldLabel);
TextAnimatorDrawer.ShowPresets(ref behaviorDrawers, ref showBehaviors, ref behaviorPresets, false, true);
TextAnimatorDrawer.ShowPresets(ref appearancesDrawers, ref showAppearances, ref appearancesPresets, true, true);
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
{
EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Actions", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(customActionsArray, true);
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
{
EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Tags Info", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(customTagsFormatting, true);
if (customTagsFormatting.boolValue)
{
EditorGUILayout.PropertyField(tagInfo_behaviors, true);
EditorGUILayout.PropertyField(tagInfo_appearances, true);
}
EditorGUI.indentLevel--;
}
if (serializedObject.hasModifiedProperties)
{
//Repaint();
//Undo.RecordObject(serializedObject.targetObject, "Changed TextAnimator Global Data Scriptable");
Undo.RecordObject(script, "Changed TextAnimator Global Data Scriptable");
EditorUtility.SetDirty(script);
//Undo.RegisterCompleteObjectUndo(script, "Changed TextAnimator Global Data Scriptable");
serializedObject.ApplyModifiedProperties();
Repaint();
TryResettingTextAnimators();
}
}
void TryResettingTextAnimators()
{
if (EditorApplication.isPlaying)
{
TAnim_EditorHelper.TriggerEvent();
}
}
}
#endif
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 02a6e80de43c2b647ad09ff47f627646
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,338 @@
using UnityEditor;
using UnityEngine;
namespace Febucci.UI.Core.Editors
{
[CustomEditor(typeof(TAnimPlayerBase), true)]
class TAnimPlayerBaseDrawer : Editor
{
SerializedProperty showLettersDinamically;
SerializedProperty startTypewriterMode;
SerializedProperty canSkipTypewriter;
SerializedProperty hideAppearancesOnSkip;
SerializedProperty triggerEventsOnSkip;
SerializedProperty disappearanceOrientation;
SerializedProperty onTextShowed;
SerializedProperty onTypewriterStart;
SerializedProperty onCharacterVisible;
SerializedProperty onTextDisappeared;
SerializedProperty resetTypingSpeedAtStartup;
string[] propertiesToExclude = new string[0];
protected virtual string[] GetPropertiesToExclude()
{
return new string[] {
"m_Script",
"useTypeWriter",
"startTypewriterMode",
"canSkipTypewriter",
"hideAppearancesOnSkip",
"triggerEventsOnSkip",
"onTextShowed",
"onTypewriterStart",
"onCharacterVisible",
"resetTypingSpeedAtStartup",
"onTextDisappeared",
"disappearanceOrientation",
};
}
protected virtual void OnEnable()
{
showLettersDinamically = serializedObject.FindProperty("useTypeWriter");
startTypewriterMode = serializedObject.FindProperty("startTypewriterMode");
canSkipTypewriter = serializedObject.FindProperty("canSkipTypewriter");
hideAppearancesOnSkip = serializedObject.FindProperty("hideAppearancesOnSkip");
triggerEventsOnSkip = serializedObject.FindProperty("triggerEventsOnSkip");
disappearanceOrientation = serializedObject.FindProperty("disappearanceOrientation");
onTextShowed = serializedObject.FindProperty("onTextShowed");
onTypewriterStart = serializedObject.FindProperty("onTypewriterStart");
onCharacterVisible = serializedObject.FindProperty("onCharacterVisible");
onTextDisappeared = serializedObject.FindProperty("onTextDisappeared");
resetTypingSpeedAtStartup = serializedObject.FindProperty("resetTypingSpeedAtStartup");
propertiesToExclude = GetPropertiesToExclude();
}
bool ButtonPlaymode(string label)
{
bool prevGUI = GUI.enabled;
GUI.enabled = Application.isPlaying;
bool value = GUILayout.Button(label, EditorStyles.miniButton, GUILayout.MaxWidth(70));
GUI.enabled = prevGUI;
return value;
}
public override void OnInspectorGUI()
{
{
EditorGUILayout.LabelField("Main Settings", EditorStyles.boldLabel);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(showLettersDinamically);
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
//Typewriter settings
{
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("Typewriter", EditorStyles.boldLabel);
if (showLettersDinamically.boolValue)
{
if (ButtonPlaymode("Start"))
{
((TAnimPlayerBase)target).StartShowingText();
}
if (ButtonPlaymode("Stop"))
{
((TAnimPlayerBase)target).StopShowingText();
}
}
EditorGUILayout.EndHorizontal();
}
if (showLettersDinamically.boolValue)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(startTypewriterMode);
EditorGUILayout.PropertyField(resetTypingSpeedAtStartup);
EditorGUILayout.LabelField("Typewriter Skip", EditorStyles.boldLabel);
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PropertyField(canSkipTypewriter);
if (canSkipTypewriter.boolValue && ButtonPlaymode("Skip"))
{
((TAnimPlayerBase)target).SkipTypewriter();
}
EditorGUILayout.EndHorizontal();
GUI.enabled = canSkipTypewriter.boolValue;
EditorGUILayout.PropertyField(hideAppearancesOnSkip);
EditorGUILayout.PropertyField(triggerEventsOnSkip);
GUI.enabled = true;
EditorGUI.indentLevel--;
}
else
{
GUI.enabled = false;
EditorGUILayout.LabelField("The typewriter is disabled");
GUI.enabled = true;
}
EditorGUILayout.Space();
//Events
{
EditorGUILayout.LabelField("Events", EditorStyles.boldLabel);
// foldoutEvents = EditorGUILayout.Foldout(foldoutEvents, "Events");
//if (foldoutEvents)
{
EditorGUILayout.PropertyField(onTextShowed);
EditorGUILayout.PropertyField(onTextDisappeared);
//GUI.enabled = showLettersDinamically.boolValue;
if (showLettersDinamically.boolValue)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(onTypewriterStart);
EditorGUILayout.PropertyField(onCharacterVisible);
EditorGUI.indentLevel--;
}
//GUI.enabled = true;
}
}
EditorGUILayout.Space();
//Typewriter
{
EditorGUILayout.LabelField("Typewriter Wait", EditorStyles.boldLabel);
EditorGUI.indentLevel++;
OnTypewriterSectionGUI();
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
//Disappearance
{
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("Disappearances", EditorStyles.boldLabel);
if (ButtonPlaymode("Start"))
{
((TAnimPlayerBase)target).StartDisappearingText();
}
if (ButtonPlaymode("Stop"))
{
((TAnimPlayerBase)target).StopDisappearingText();
}
EditorGUILayout.EndHorizontal();
EditorGUI.indentLevel++;
GUI.enabled = false;
EditorGUILayout.LabelField("To start disappearances, please call the 'StartDisappearingText()' method. See the docs for more.", EditorStyles.wordWrappedMiniLabel);
GUI.enabled = true;
EditorGUILayout.PropertyField(disappearanceOrientation);
OnDisappearanceSectionGUI();
EditorGUI.indentLevel--;
}
//Draws parent without the children (so, TanimPlayerBase can have a custom inspector)
DrawPropertiesExcluding(serializedObject, propertiesToExclude);
if (serializedObject.hasModifiedProperties)
{
serializedObject.ApplyModifiedProperties();
}
}
protected virtual void OnTypewriterSectionGUI()
{
}
protected virtual void OnDisappearanceSectionGUI()
{
}
}
[CustomEditor(typeof(TextAnimatorPlayer), true)]
class TAnimPlayerDrawer : TAnimPlayerBaseDrawer
{
SerializedProperty waitForNormalChars;
SerializedProperty waitLong;
SerializedProperty waitMiddle;
SerializedProperty avoidMultiplePunctuactionWait;
SerializedProperty waitForNewLines;
SerializedProperty waitForLastCharacter;
PropertyWithDifferentLabel useTypewriterWaitForDisappearances;
PropertyWithDifferentLabel disappearanceWaitTime;
PropertyWithDifferentLabel disappearanceSpeedMultiplier;
struct PropertyWithDifferentLabel
{
public SerializedProperty property;
public GUIContent label;
public PropertyWithDifferentLabel(SerializedObject obj, string property, string label)
{
this.property = obj.FindProperty(property);
this.label = new GUIContent(label);
}
public void PropertyField()
{
EditorGUILayout.PropertyField(property, label);
}
}
protected override void OnEnable()
{
base.OnEnable();
waitForNormalChars = serializedObject.FindProperty("waitForNormalChars");
waitLong = serializedObject.FindProperty("waitLong");
waitMiddle = serializedObject.FindProperty("waitMiddle");
avoidMultiplePunctuactionWait = serializedObject.FindProperty("avoidMultiplePunctuactionWait");
waitForNewLines = serializedObject.FindProperty("waitForNewLines");
waitForLastCharacter = serializedObject.FindProperty("waitForLastCharacter");
useTypewriterWaitForDisappearances = new PropertyWithDifferentLabel(serializedObject, "useTypewriterWaitForDisappearances", "Use Typewriter Wait Times");
disappearanceSpeedMultiplier = new PropertyWithDifferentLabel(serializedObject, "disappearanceSpeedMultiplier", "Typewriter Speed Multiplier");
disappearanceWaitTime = new PropertyWithDifferentLabel(serializedObject, "disappearanceWaitTime", "Disappearances Wait");
}
protected override string[] GetPropertiesToExclude()
{
string[] newProperties = new string[] {
"script",
"waitForNormalChars",
"waitLong",
"waitMiddle",
"avoidMultiplePunctuactionWait",
"waitForNewLines",
"waitForLastCharacter",
"useTypewriterWaitForDisappearances",
"disappearanceSpeedMultiplier",
"disappearanceWaitTime"
};
string[] baseProperties = base.GetPropertiesToExclude();
string[] mergedArray = new string[newProperties.Length + baseProperties.Length];
for (int i = 0; i < baseProperties.Length; i++)
{
mergedArray[i] = baseProperties[i];
}
for (int i = 0; i < newProperties.Length; i++)
{
mergedArray[i + baseProperties.Length] = newProperties[i];
}
return mergedArray;
}
protected override void OnTypewriterSectionGUI()
{
EditorGUILayout.PropertyField(waitForNormalChars);
EditorGUILayout.PropertyField(waitLong);
EditorGUILayout.PropertyField(waitMiddle);
EditorGUILayout.PropertyField(avoidMultiplePunctuactionWait);
EditorGUILayout.PropertyField(waitForNewLines);
EditorGUILayout.PropertyField(waitForLastCharacter);
}
protected override void OnDisappearanceSectionGUI()
{
useTypewriterWaitForDisappearances.PropertyField();
if (useTypewriterWaitForDisappearances.property.boolValue)
disappearanceSpeedMultiplier.PropertyField();
else
disappearanceWaitTime.PropertyField();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c505a7fbdbbf6604f9f76bf0afbec264
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e547d15ba02680d41823b4288063b1d4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -0,0 +1,99 @@
fileFormatVersion: 2
guid: 04f06a54beeb7574a8c2b2083e7be396
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 4c61e790940ecb64e876d955039cd056
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant: