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,8 @@
fileFormatVersion: 2
guid: 4b35db61dfff3d843ac76bc4f9b2669b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,27 @@
namespace Febucci.UI.Core
{
/// <summary>
/// Base class for all behavior effects.<br/>
/// Inherit from this class if you want to create your own Behavior Effect in C#.
/// </summary>
public abstract class BehaviorBase : EffectsBase
{
public abstract void SetDefaultValues(BehaviorDefaultValues data);
[System.Obsolete("This variable will be removed from next versions. Please use 'time.timeSinceStart' instead")]
public float animatorTime => time.timeSinceStart;
[System.Obsolete("This variable will be removed from next versions. Please use 'time.deltaTime' instead")]
public float animatorDeltaTime => time.deltaTime;
/// <summary>
/// Contains data/settings from the TextAnimator component that is linked to (and managing) this effect.
/// </summary>
public TextAnimator.TimeData time { get; private set; }
internal void SetAnimatorData(in TextAnimator.TimeData time)
{
this.time = time;
}
}
}

View File

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

View File

@@ -0,0 +1,39 @@
using UnityEngine;
namespace Febucci.UI.Core
{
/// <summary>
/// Behavior helper class that automatically manages the following modifiers: (a = <see cref="amplitude"/>), (f = <see cref="frequency"/>) and (w = <see cref="waveSize"/>).<br/><br/>
/// You can inerith from this class and use the modifiers as you prefer in your effects, without having to set up them inside the <see cref="SetModifier(string, string)"/> method.
/// </summary>
/// <example>
/// All the TextAnimator effects that have 3 modifiers inerith from this class. You can check their source code to see how they are set up, example: <see cref="WiggleBehavior"/> or <see cref="WaveBehavior"/>
/// </example>
public abstract class BehaviorSine : BehaviorBase
{
protected float amplitude = 1;
protected float frequency = 1;
protected float waveSize = .08f;
public override void SetModifier(string modifierName, string modifierValue)
{
switch (modifierName)
{
//amplitude
case "a": ApplyModifierTo(ref amplitude, modifierValue); break;
//frequency
case "f": ApplyModifierTo(ref frequency, modifierValue); break;
//wave size
case "w": ApplyModifierTo(ref waveSize, modifierValue); break;
}
}
public override string ToString()
{
return $"freq: {frequency}\n" +
$"ampl: {amplitude}\n" +
$"waveSize: {waveSize}" +
$"\n{base.ToString()}";
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,41 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Bounce)]
class BounceBehavior : BehaviorSine
{
public override void SetDefaultValues(BehaviorDefaultValues data)
{
amplitude = data.defaults.bounceAmplitude;
frequency = data.defaults.bounceFrequency;
waveSize = data.defaults.bounceWaveSize;
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
//Calculates the tween percentage
float BounceTween(float t)
{
const float stillTime = .2f;
const float easeIn = .2f;
const float bounce = 1 - stillTime - easeIn;
if (t <= easeIn)
return Tween.EaseInOut(t / easeIn);
t -= easeIn;
if (t <= bounce)
return 1 - Tween.BounceOut(t / bounce);
return 0;
}
data.vertices.MoveChar(Vector3.up * uniformIntensity * BounceTween((Mathf.Repeat(time.timeSinceStart * frequency - waveSize * charIndex, 1))) * amplitude);
}
}
}

View File

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

View File

@@ -0,0 +1,43 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Dangle)]
class DangleBehavior : BehaviorSine
{
float sin;
int targetIndex1;
int targetIndex2;
public override void SetDefaultValues(BehaviorDefaultValues data)
{
amplitude = data.defaults.dangleAmplitude;
frequency = data.defaults.dangleFrequency;
waveSize = data.defaults.dangleWaveSize;
//bottom
if (data.defaults.dangleAnchorBottom)
{
targetIndex1 = 1;
targetIndex2 = 2;
}
else
{
targetIndex1 = 0;
targetIndex2 = 3;
}
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
sin = Mathf.Sin(frequency * time.timeSinceStart + charIndex * waveSize) * amplitude * uniformIntensity;
//moves one side (top or bottom) torwards one direction
data.vertices[targetIndex1] += Vector3.right * sin;
data.vertices[targetIndex2] += Vector3.right * sin;
}
}
}

View File

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

View File

@@ -0,0 +1,75 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Fade)]
class FadeBehavior : BehaviorBase
{
float delay = .3f;
float[] charPCTs;
public override void SetDefaultValues(BehaviorDefaultValues data)
{
delay = data.defaults.fadeDelay;
}
public override void Initialize(int charactersCount)
{
base.Initialize(charactersCount);
charPCTs = new float[charactersCount];
}
public override void SetModifier(string modifierName, string modifierValue)
{
switch (modifierName)
{
//delay
case "d": ApplyModifierTo(ref delay, modifierValue); break;
}
}
Color32 temp;
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
if (data.passedTime <= delay) //not passed enough time yet
return;
charPCTs[charIndex] += time.deltaTime;
if (charPCTs[charIndex] > 1) charPCTs [charIndex] = 1;
//Lerps
if (charPCTs[charIndex] < 1 && charPCTs[charIndex] >= 0)
{
for (var i = 0; i < TextUtilities.verticesPerChar; i++)
{
temp = data.colors[i];
temp.a = 0;
data.colors[i] = Color32.LerpUnclamped(data.colors[i], temp, Tween.EaseInOut(charPCTs[charIndex]));
}
}
else //Keeps them hidden
{
for (var i = 0; i < TextUtilities.verticesPerChar; i++)
{
temp = data.colors[i];
temp.a = 0;
data.colors[i] = temp;
}
}
}
public override string ToString()
{
return $"delay: {delay}\n" +
$"\n{ base.ToString()}";
}
}
}

View File

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

View File

@@ -0,0 +1,41 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Pendulum)]
class PendulumBehavior : BehaviorSine
{
int targetVertex1;
int targetVertex2;
public override void SetDefaultValues(BehaviorDefaultValues data)
{
frequency = data.defaults.pendFrequency;
amplitude = data.defaults.pendAmplitude;
waveSize = data.defaults.pendWaveSize;
if (data.defaults.pendInverted)
{
//anchored at the bottom
targetVertex1 = 0;
targetVertex2 = 3;
}
else
{
//anchored at the top
targetVertex1 = 1;
targetVertex2 = 2;
}
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
data.vertices.RotateChar(
Mathf.Sin(-time.timeSinceStart * frequency + waveSize * charIndex) * amplitude,
(data.vertices[targetVertex1] + data.vertices[targetVertex2]) / 2 //bottom center as their rotation pivot
);
}
}
}

View File

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

View File

@@ -0,0 +1,50 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Rainb)]
class RainbowBehavior : BehaviorBase
{
float hueShiftSpeed = 0.8f;
float hueShiftWaveSize = 0.08f;
public override void SetDefaultValues(BehaviorDefaultValues data)
{
hueShiftSpeed = data.defaults.hueShiftSpeed;
hueShiftWaveSize = data.defaults.hueShiftWaveSize;
}
public override void SetModifier(string modifierName, string modifierValue)
{
switch (modifierName)
{
//frequency
case "f": ApplyModifierTo(ref hueShiftSpeed, modifierValue); break;
//wave size
case "s": ApplyModifierTo(ref hueShiftWaveSize, modifierValue); break;
}
}
Color32 temp;
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
for (byte i = 0; i < TextUtilities.verticesPerChar; i++)
{
//shifts hue
temp = Color.HSVToRGB(Mathf.PingPong(time.timeSinceStart * hueShiftSpeed + charIndex * hueShiftWaveSize, 1), 1, 1);
temp.a = data.colors[i].a; //preserves original alpha
data.colors[i] = temp;
}
}
public override string ToString()
{
return $"hueShiftSpeed: {hueShiftSpeed}\n" +
$"hueShiftWaveSize: {hueShiftWaveSize}" +
$"\n{base.ToString()}";
}
}
}

View File

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

View File

@@ -0,0 +1,43 @@
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Rot)]
class RotationBehavior : BehaviorBase
{
float angleSpeed = 180;
float angleDiffBetweenChars = 10;
public override void SetDefaultValues(BehaviorDefaultValues data)
{
angleSpeed = data.defaults.angleSpeed;
angleDiffBetweenChars = data.defaults.angleDiffBetweenChars;
}
public override void SetModifier(string modifierName, string modifierValue)
{
switch (modifierName)
{
//frequency
case "f": ApplyModifierTo(ref angleSpeed, modifierValue); break;
//angle diff
case "s": ApplyModifierTo(ref angleDiffBetweenChars, modifierValue); break;
}
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
data.vertices.RotateChar(-time.timeSinceStart * angleSpeed + angleDiffBetweenChars * charIndex);
}
public override string ToString()
{
return $"angleSpeed: {angleSpeed}\n" +
$"angleDiffBetweenChars: {angleDiffBetweenChars}" +
$"\n{base.ToString()}";
}
}
}

View File

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

View File

@@ -0,0 +1,92 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Shake)]
class ShakeBehavior : BehaviorBase
{
public float shakeStrength;
public float shakeDelay;
float timePassed;
int randIndex;
public override void SetDefaultValues(BehaviorDefaultValues data)
{
shakeDelay = data.defaults.shakeDelay;
shakeStrength = data.defaults.shakeStrength;
ClampValues();
}
void ClampValues()
{
shakeDelay = Mathf.Clamp(shakeDelay, 0.002f, 500);
}
public override void Initialize(int charactersCount)
{
base.Initialize(charactersCount);
randIndex = Random.Range(0, TextUtilities.fakeRandomsCount);
lastRandomIndex = randIndex;
}
public override void SetModifier(string modifierName, string modifierValue)
{
switch (modifierName)
{
//amplitude
case "a": ApplyModifierTo(ref shakeStrength, modifierValue); break;
//delay
case "d": ApplyModifierTo(ref shakeDelay, modifierValue); break;
}
ClampValues();
}
int lastRandomIndex;
public override void Calculate()
{
timePassed += time.deltaTime;
//Changes the shake direction if enough time passed
if (timePassed >= shakeDelay)
{
timePassed = 0;
randIndex = Random.Range(0, TextUtilities.fakeRandomsCount);
//Avoids repeating the same index twice
if (lastRandomIndex == randIndex)
{
randIndex++;
if (randIndex >= TextUtilities.fakeRandomsCount)
randIndex = 0;
}
lastRandomIndex = randIndex;
}
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
data.vertices.MoveChar
(
TextUtilities.fakeRandoms[
Mathf.RoundToInt((charIndex + randIndex) % (TextUtilities.fakeRandomsCount - 1))
] * shakeStrength * uniformIntensity
);
}
public override string ToString()
{
return $"shake delay: {shakeDelay}\n" +
$"strength: {shakeStrength}" +
$"\n{ base.ToString()}";
}
}
}

View File

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

View File

@@ -0,0 +1,23 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Incr)]
sealed class SizeBehavior : BehaviorSine
{
public override void SetDefaultValues(BehaviorDefaultValues data)
{
amplitude = data.defaults.sizeAmplitude * -1 + 1;
frequency = data.defaults.sizeFrequency;
waveSize = data.defaults.sizeWaveSize;
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
data.vertices.LerpUnclamped(
data.vertices.GetMiddlePos(),
(Mathf.Cos(time.timeSinceStart* frequency + charIndex * waveSize) + 1) / 2f * amplitude);
}
}
}

View File

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

View File

@@ -0,0 +1,30 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Slide)]
class SlideBehavior : BehaviorSine
{
float sin;
public override void SetDefaultValues(BehaviorDefaultValues data)
{
amplitude = data.defaults.slideAmplitude;
frequency = data.defaults.slideFrequency;
waveSize = data.defaults.slideWaveSize;
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
sin = Mathf.Sin(frequency * time.timeSinceStart + charIndex * waveSize) * amplitude * uniformIntensity;
//bottom, torwards one direction
data.vertices[0] += Vector3.right * sin;
data.vertices[3] += Vector3.right * sin;
//top, torwards the opposite dir
data.vertices[1] += Vector3.right * -sin;
data.vertices[2] += Vector3.right * -sin;
}
}
}

View File

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

View File

@@ -0,0 +1,22 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Swing)]
class SwingBehavior : BehaviorSine
{
public override void SetDefaultValues(BehaviorDefaultValues data)
{
amplitude = data.defaults.swingAmplitude;
frequency = data.defaults.swingFrequency;
waveSize = data.defaults.swingWaveSize;
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
data.vertices.RotateChar(Mathf.Cos(time.timeSinceStart * frequency + charIndex * waveSize) * amplitude);
}
}
}

View File

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

View File

@@ -0,0 +1,23 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Wave)]
class WaveBehavior : BehaviorSine
{
public override void SetDefaultValues(BehaviorDefaultValues data)
{
amplitude = data.defaults.waveAmplitude;
frequency = data.defaults.waveFrequency;
waveSize = data.defaults.waveWaveSize;
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
data.vertices.MoveChar(Vector3.up * Mathf.Sin(time.timeSinceStart * frequency + charIndex * waveSize) * amplitude * uniformIntensity);
}
}
}

View File

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

View File

@@ -0,0 +1,59 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: TAnimTags.bh_Wiggle)]
class WiggleBehavior : BehaviorBase
{
float amplitude = 0.15f;
float frequency = 7.67f;
Vector3[] directions;
public override void SetDefaultValues(BehaviorDefaultValues data)
{
amplitude = data.defaults.wiggleAmplitude;
frequency = data.defaults.wiggleFrequency;
}
public override void Initialize(int charactersCount)
{
base.Initialize(charactersCount);
directions = new Vector3[charactersCount];
//Calculates a random direction for each character (which won't change)
for(int i = 0; i < charactersCount; i++)
{
directions[i] = TextUtilities.fakeRandoms[Random.Range(0, TextUtilities.fakeRandomsCount - 1)] * Mathf.Sign(Mathf.Sin(i));
}
}
public override void SetModifier(string modifierName, string modifierValue)
{
switch (modifierName)
{
//amplitude
case "a": ApplyModifierTo(ref amplitude, modifierValue); break;
//frequency
case "f": ApplyModifierTo(ref frequency, modifierValue); break;
}
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
data.vertices.MoveChar(directions[charIndex] * Mathf.Sin(time.timeSinceStart* frequency + charIndex) * amplitude * uniformIntensity);
}
public override string ToString()
{
return $"freq: {frequency}\n" +
$"ampl: {amplitude}" +
$"\n{ base.ToString()}";
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,149 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[UnityEngine.Scripting.Preserve]
[EffectInfo(tag: "")]
class PresetBehavior : BehaviorBase
{
bool enabled;
//modifiers
float timeSpeed;
float weightMult;
//management
Matrix4x4 matrix;
Vector3 offset;
Quaternion rotationQua;
float uniformEffectTime;
bool hasTransformEffects;
bool isOnOneCharacter;
float weight = 1;
EmissionControl emissionControl;
PresetAppearance.ThreeAxisEffector movement;
PresetAppearance.ThreeAxisEffector rotation;
PresetAppearance.TwoAxisEffector scale;
bool setColor;
Color32 color;
ColorCurve colorCurve;
public override void SetDefaultValues(BehaviorDefaultValues data)
{
weightMult = 1;
timeSpeed = 1;
uniformEffectTime = 0;
weight = 0;
isOnOneCharacter = false;
enabled = false;
void AssignValues(PresetBehaviorValues result)
{
float showDuration = 0;
emissionControl = result.emission;
enabled = PresetAppearance.SetPreset(
false,
result,
ref movement,
ref showDuration,
ref rotation,
ref scale,
ref rotationQua,
ref hasTransformEffects,
ref setColor,
ref colorCurve);
emissionControl.Initialize(showDuration);
}
PresetBehaviorValues values;
//searches for local presets first, which override global presets
if (TAnimBuilder.GetPresetFromArray(effectTag, data.presets, out values))
{
AssignValues(values);
return;
}
//global presets
if (TAnimBuilder.TryGetGlobalPresetBehavior(effectTag, out values))
{
AssignValues(values);
return;
}
}
public override void SetModifier(string modifierName, string modifierValue)
{
switch (modifierName)
{
case "f": //frequency, increases the time speed
ApplyModifierTo(ref timeSpeed, modifierValue);
break;
case "a": //increase the amplitude
ApplyModifierTo(ref weightMult, modifierValue);
break;
}
}
public override void Calculate()
{
if (!isOnOneCharacter)
return;
uniformEffectTime = emissionControl.IncreaseEffectTime(time.deltaTime * timeSpeed);
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
if (!enabled)
return;
if (!isOnOneCharacter)
isOnOneCharacter = data.passedTime > 0;
weight = emissionControl.effectWeigth * weightMult;
if (weight == 0) //no effect
return;
if (hasTransformEffects)
{
offset = (data.vertices[0] + data.vertices[2]) / 2f;
//weighted rotation
rotationQua.eulerAngles = rotation.EvaluateEffect(uniformEffectTime, charIndex) * weight;
matrix.SetTRS(
movement.EvaluateEffect(uniformEffectTime, charIndex) * uniformIntensity * weight,
rotationQua,
Vector3.LerpUnclamped(Vector3.one, scale.EvaluateEffect(uniformEffectTime, charIndex), weight));
for (byte i = 0; i < data.vertices.Length; i++)
{
data.vertices[i] -= offset;
data.vertices[i] = matrix.MultiplyPoint3x4(data.vertices[i]);
data.vertices[i] += offset;
}
}
if (setColor)
{
color = colorCurve.GetColor(uniformEffectTime, charIndex);
data.colors.LerpUnclamped(color, Mathf.Clamp(weight, -1, 1));
}
}
}
}

View File

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

View File

@@ -0,0 +1,20 @@
using UnityEngine;
namespace Febucci.UI.Core
{
[System.Serializable]
internal class PresetBehaviorValues : PresetBaseValues
{
#pragma warning disable 0649 //disabling the error or unity will throw "field is never assigned" [..], because we actually assign the variables from the custom drawers
[SerializeField] public EmissionControl emission;
#pragma warning restore 0649
public override void Initialize(bool isAppearance)
{
base.Initialize(isAppearance);
emission.Initialize(GetMaxDuration());
}
}
}

View File

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