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,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: