Added Feel plugin

This commit is contained in:
journaliciouz
2025-12-11 14:49:16 +01:00
parent 97dce4aaf6
commit 1942a531d4
2820 changed files with 257786 additions and 9 deletions

View File

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

View File

@@ -0,0 +1,246 @@
using MoreMountains.Tools;
using UnityEngine;
using System.Collections;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you control the alpha of a target TMP over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you control the alpha of a target TMP over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Alpha")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPAlpha : MMF_Feedback
{
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
public enum AlphaModes { Instant, Interpolate, ToDestination }
/// the duration of this feedback is the duration of the color transition, or 0 if instant
public override float FeedbackDuration { get { return (AlphaMode == AlphaModes.Instant) ? 0f : ApplyTimeMultiplier(Duration); } set { Duration = value; } }
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
public override bool HasCustomInspectors => true;
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip(" TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Alpha", true, 16)]
/// the selected color mode :
/// None : nothing will happen,
/// gradient : evaluates the color over time on that gradient, from left to right,
/// interpolate : lerps from the current color to the destination one
[Tooltip("the selected color mode :" +
"Instant : the alpha will change instantly to the target one," +
"Curve : the alpha will be interpolated along the curve," +
"interpolate : lerps from the current color to the destination one ")]
public AlphaModes AlphaMode = AlphaModes.Interpolate;
/// how long the color of the text should change over time
[Tooltip("how long the color of the text should change over time")]
[MMFEnumCondition("AlphaMode", (int)AlphaModes.Interpolate, (int)AlphaModes.ToDestination)]
public float Duration = 0.2f;
/// the alpha to apply when in instant mode
[Tooltip("the alpha to apply when in instant mode")]
[MMFEnumCondition("AlphaMode", (int)AlphaModes.Instant)]
public float InstantAlpha = 1f;
/// the curve to use when interpolating towards the destination alpha
[Tooltip("the curve to use when interpolating towards the destination alpha")]
public MMTweenType Curve = new MMTweenType(MMTween.MMTweenCurve.EaseInCubic, "", "AlphaMode", (int)AlphaModes.Interpolate, (int)AlphaModes.ToDestination);
/// the value to which the curve's 0 should be remapped
[Tooltip("the value to which the curve's 0 should be remapped")]
[MMFEnumCondition("AlphaMode", (int)AlphaModes.Interpolate)]
public float CurveRemapZero = 0f;
/// the value to which the curve's 1 should be remapped
[Tooltip("the value to which the curve's 1 should be remapped")]
[MMFEnumCondition("AlphaMode", (int)AlphaModes.Interpolate)]
public float CurveRemapOne = 1f;
/// the alpha to aim towards when in ToDestination mode
[Tooltip("the alpha to aim towards when in ToDestination mode")]
[MMFEnumCondition("AlphaMode", (int)AlphaModes.ToDestination)]
public float DestinationAlpha = 1f;
/// if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over
[Tooltip("if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over")]
public bool AllowAdditivePlays = false;
protected float _initialAlpha;
protected Coroutine _coroutine;
/// <summary>
/// On init we store our initial alpha
/// </summary>
/// <param name="owner"></param>
protected override void CustomInitialization(MMF_Player owner)
{
base.CustomInitialization(owner);
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
_initialAlpha = TargetTMPText.alpha;
#endif
}
/// <summary>
/// On Play we change our text's alpha
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
switch (AlphaMode)
{
case AlphaModes.Instant:
TargetTMPText.alpha = NormalPlayDirection ? InstantAlpha : _initialAlpha;
break;
case AlphaModes.Interpolate:
if (!AllowAdditivePlays && (_coroutine != null))
{
return;
}
if (_coroutine != null) { Owner.StopCoroutine(_coroutine); }
_coroutine = Owner.StartCoroutine(ChangeAlpha());
break;
case AlphaModes.ToDestination:
if (!AllowAdditivePlays && (_coroutine != null))
{
return;
}
_initialAlpha = TargetTMPText.alpha;
if (_coroutine != null) { Owner.StopCoroutine(_coroutine); }
_coroutine = Owner.StartCoroutine(ChangeAlpha());
break;
}
#endif
}
/// <summary>
/// Changes the color of the text over time
/// </summary>
/// <returns></returns>
protected virtual IEnumerator ChangeAlpha()
{
float journey = NormalPlayDirection ? 0f : FeedbackDuration;
IsPlaying = true;
while ((journey >= 0) && (journey <= FeedbackDuration) && (FeedbackDuration > 0))
{
float remappedTime = MMFeedbacksHelpers.Remap(journey, 0f, FeedbackDuration, 0f, 1f);
SetAlpha(remappedTime);
journey += NormalPlayDirection ? FeedbackDeltaTime : -FeedbackDeltaTime;
yield return null;
}
SetAlpha(FinalNormalizedTime);
_coroutine = null;
IsPlaying = false;
yield break;
}
/// <summary>
/// Stops the animation if needed
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
IsPlaying = false;
if (_coroutine != null)
{
Owner.StopCoroutine(_coroutine);
_coroutine = null;
}
}
/// <summary>
/// Applies the alpha change
/// </summary>
/// <param name="time"></param>
protected virtual void SetAlpha(float time)
{
#if MM_UGUI2
float newAlpha = 0f;
if (AlphaMode == AlphaModes.Interpolate)
{
newAlpha = MMTween.Tween(time, 0f, 1f, CurveRemapZero, CurveRemapOne, Curve);
}
else if (AlphaMode == AlphaModes.ToDestination)
{
newAlpha = MMTween.Tween(time, 0f, 1f, _initialAlpha, DestinationAlpha, Curve);
}
TargetTMPText.alpha = newAlpha;
#endif
}
/// <summary>
/// On restore, we put our object back at its initial position
/// </summary>
protected override void CustomRestoreInitialValues()
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
TargetTMPText.alpha = _initialAlpha;
#endif
}
/// <summary>
/// On Validate, we init our curves conditions if needed
/// </summary>
public override void OnValidate()
{
base.OnValidate();
if (string.IsNullOrEmpty(Curve.EnumConditionPropertyName))
{
Curve.EnumConditionPropertyName = "AlphaMode";
Curve.EnumConditions = new bool[32];
Curve.EnumConditions[(int)AlphaModes.Interpolate] = true;
Curve.EnumConditions[(int)AlphaModes.ToDestination] = true;
}
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: a4be8a3950b608c4785907ebe6be06ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPAlpha.cs
uploadId: 830868

View File

@@ -0,0 +1,92 @@
using MoreMountains.Tools;
using UnityEngine;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you control the character spacing of a target TMP over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you control the character spacing of a target TMP over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Character Spacing")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPCharacterSpacing : MMF_FeedbackBase
{
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
public override bool CanForceInitialValue => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip("the TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Character Spacing", true, 16)]
/// the curve to tween on
[Tooltip("the curve to tween on")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime, (int)Modes.ToDestination)]
public MMTweenType CharacterSpacingCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapOne = 1f;
/// the value to move to in instant mode
[Tooltip("the value to move to in instant mode")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.Instant)]
public float InstantSpacing;
/// the value to move to in destination mode
[Tooltip("the value to move to in destination mode")]
[MMFEnumCondition("Mode", (int)Modes.ToDestination)]
public float DestinationSpacing;
protected override void FillTargets()
{
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
MMF_FeedbackBaseTarget target = new MMF_FeedbackBaseTarget();
MMPropertyReceiver receiver = new MMPropertyReceiver();
receiver.TargetObject = TargetTMPText.gameObject;
receiver.TargetComponent = TargetTMPText;
receiver.TargetPropertyName = "characterSpacing";
receiver.RelativeValue = RelativeValues;
target.Target = receiver;
target.LevelCurve = CharacterSpacingCurve;
target.RemapLevelZero = RemapZero;
target.RemapLevelOne = RemapOne;
target.InstantLevel = InstantSpacing;
target.ToDestinationLevel = DestinationSpacing;
_targets.Add(target);
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: f58aef5c589e998418e5d3ec374edefe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPCharacterSpacing.cs
uploadId: 830868

View File

@@ -0,0 +1,224 @@
using UnityEngine;
using System.Collections;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you control the color of a target TMP over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you control the color of a target TMP over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Color")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPColor : MMF_Feedback
{
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
public enum ColorModes { Instant, Gradient, Interpolate }
/// the duration of this feedback is the duration of the color transition, or 0 if instant
public override float FeedbackDuration { get { return (ColorMode == ColorModes.Instant) ? 0f : ApplyTimeMultiplier(Duration); } set { Duration = value; } }
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip(" TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Color", true, 16)]
/// the selected color mode :
/// None : nothing will happen,
/// gradient : evaluates the color over time on that gradient, from left to right,
/// interpolate : lerps from the current color to the destination one
[Tooltip("the selected color mode :" +
"None : nothing will happen," +
"gradient : evaluates the color over time on that gradient, from left to right," +
"interpolate : lerps from the current color to the destination one ")]
public ColorModes ColorMode = ColorModes.Interpolate;
/// how long the color of the text should change over time
[Tooltip("how long the color of the text should change over time")]
[MMFEnumCondition("ColorMode", (int)ColorModes.Interpolate, (int)ColorModes.Gradient)]
public float Duration = 0.2f;
/// the color to apply
[Tooltip("the color to apply")]
[MMFEnumCondition("ColorMode", (int)ColorModes.Instant)]
public Color InstantColor = Color.yellow;
/// the gradient to use to animate the color over time
[Tooltip("the gradient to use to animate the color over time")]
[MMFEnumCondition("ColorMode", (int)ColorModes.Gradient)]
[GradientUsage(true)]
public Gradient ColorGradient;
/// the destination color when in interpolate mode
[Tooltip("the destination color when in interpolate mode")]
[MMFEnumCondition("ColorMode", (int)ColorModes.Interpolate)]
public Color DestinationColor = Color.yellow;
/// the curve to use when interpolating towards the destination color
[Tooltip("the curve to use when interpolating towards the destination color")]
[MMFEnumCondition("ColorMode", (int)ColorModes.Interpolate)]
public AnimationCurve ColorCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over
[Tooltip("if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over")]
public bool AllowAdditivePlays = false;
protected Color _initialColor;
protected Coroutine _coroutine;
/// <summary>
/// On init we store our initial color
/// </summary>
/// <param name="owner"></param>
protected override void CustomInitialization(MMF_Player owner)
{
base.CustomInitialization(owner);
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
_initialColor = TargetTMPText.color;
#endif
}
/// <summary>
/// On Play we change our text's color
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
switch (ColorMode)
{
case ColorModes.Instant:
TargetTMPText.color = NormalPlayDirection ? InstantColor : _initialColor;;
break;
case ColorModes.Gradient:
if (!AllowAdditivePlays && (_coroutine != null))
{
return;
}
if (_coroutine != null) { Owner.StopCoroutine(_coroutine); }
_coroutine = Owner.StartCoroutine(ChangeColor());
break;
case ColorModes.Interpolate:
if (!AllowAdditivePlays && (_coroutine != null))
{
return;
}
if (_coroutine != null) { Owner.StopCoroutine(_coroutine); }
_coroutine = Owner.StartCoroutine(ChangeColor());
break;
}
#endif
}
/// <summary>
/// Changes the color of the text over time
/// </summary>
/// <returns></returns>
protected virtual IEnumerator ChangeColor()
{
float journey = NormalPlayDirection ? 0f : FeedbackDuration;
IsPlaying = true;
while ((journey >= 0) && (journey <= FeedbackDuration) && (FeedbackDuration > 0))
{
float remappedTime = MMFeedbacksHelpers.Remap(journey, 0f, FeedbackDuration, 0f, 1f);
SetColor(remappedTime);
journey += NormalPlayDirection ? FeedbackDeltaTime : -FeedbackDeltaTime;
yield return null;
}
SetColor(FinalNormalizedTime);
_coroutine = null;
IsPlaying = false;
yield break;
}
/// <summary>
/// Stops the animation if needed
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
IsPlaying = false;
if (_coroutine != null)
{
Owner.StopCoroutine(_coroutine);
_coroutine = null;
}
}
/// <summary>
/// Applies the color change
/// </summary>
/// <param name="time"></param>
protected virtual void SetColor(float time)
{
#if MM_UGUI2
if (ColorMode == ColorModes.Gradient)
{
TargetTMPText.color = ColorGradient.Evaluate(time);
}
else if (ColorMode == ColorModes.Interpolate)
{
float factor = ColorCurve.Evaluate(time);
TargetTMPText.color = Color.LerpUnclamped(_initialColor, DestinationColor, factor);
}
#endif
}
/// <summary>
/// On restore, we put our object back at its initial position
/// </summary>
protected override void CustomRestoreInitialValues()
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
TargetTMPText.color = _initialColor;
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: cb001ad73daba6d49b6183ff4079ebb6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPColor.cs
uploadId: 830868

View File

@@ -0,0 +1,188 @@
using System.Collections;
using System.Collections.Generic;
using MoreMountains.Tools;
using UnityEngine;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback will let you update a TMP text value over time, with a value going from A to B over time, on a curve
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback will let you update a TMP text value over time, with a value going from A to B over time, on a curve")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Count To")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPCountTo : MMF_Feedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
/// the duration of this feedback is the duration of the scale animation
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("TextMeshPro Target Text", true, 12, true)]
/// the target TMP_Text component we want to change the text on
[Tooltip("the target TMP_Text component we want to change the text on")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Count Settings", true, 13)]
/// the value from which to count from
[Tooltip("the value from which to count from")]
public float CountFrom = 0f;
/// the value to count towards
[Tooltip("the value to count towards")]
public float CountTo = 10f;
/// the curve on which to animate the count
[Tooltip("the curve on which to animate the count")]
public MMTweenType CountingCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1f)));
/// the duration of the count, in seconds
[Tooltip("the duration of the count, in seconds")]
public float Duration = 5f;
/// the format with which to display the count
[Tooltip("the format with which to display the count")]
public string Format = "00.00";
/// whether or not value should be floored
[Tooltip("whether or not value should be floored")]
public bool FloorValues = true;
/// the minimum frequency (in seconds) at which to refresh the text field
[Tooltip("the minimum frequency (in seconds) at which to refresh the text field")]
public float MinRefreshFrequency = 0f;
protected string _newText;
protected float _startTime;
protected float _lastRefreshAt;
protected string _initialText;
protected Coroutine _coroutine;
/// <summary>
/// On play we change the text of our target TMPText over time
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
_initialText = TargetTMPText.text;
#endif
_coroutine = Owner.StartCoroutine(CountCo());
}
/// <summary>
/// A coroutine used to animate the text
/// </summary>
/// <returns></returns>
protected virtual IEnumerator CountCo()
{
IsPlaying = true;
_lastRefreshAt = -float.MaxValue;
float currentValue = CountFrom;
_startTime = FeedbackTime;
while (FeedbackTime - _startTime <= Duration)
{
if (FeedbackTime - _lastRefreshAt >= MinRefreshFrequency)
{
currentValue = ProcessCount();
UpdateText(currentValue);
_lastRefreshAt = FeedbackTime;
}
yield return null;
}
UpdateText(CountTo);
IsPlaying = false;
}
/// <summary>
/// Updates the text of the target TMPText component with the updated value
/// </summary>
/// <param name="currentValue"></param>
protected virtual void UpdateText(float currentValue)
{
if (FloorValues)
{
_newText = Mathf.Floor(currentValue).ToString(Format);
}
else
{
_newText = currentValue.ToString(Format);
}
#if MM_UGUI2
TargetTMPText.text = _newText;
#endif
}
/// <summary>
/// Computes the new value of the count for the current time
/// </summary>
/// <param name="currentValue"></param>
/// <returns></returns>
protected virtual float ProcessCount()
{
float currentTime = FeedbackTime - _startTime;
float currentValue = MMTween.Tween(currentTime, 0f, Duration, CountFrom, CountTo, CountingCurve);
return currentValue;
}
/// <summary>
/// On stop, we interrupt counting if it was active
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized || (_coroutine == null))
{
return;
}
IsPlaying = false;
Owner.StopCoroutine(_coroutine);
_coroutine = null;
}
/// <summary>
/// On restore, we put our object back at its initial position
/// </summary>
protected override void CustomRestoreInitialValues()
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
TargetTMPText.text = _initialText;
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 76ee492955c4d2f4fa9c0dd9f9a59f12
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPCountTo.cs
uploadId: 830868

View File

@@ -0,0 +1,176 @@
using System.Collections;
using System.Collections.Generic;
using MoreMountains.Tools;
using UnityEngine;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback will let you update a TMP text value over time, with a long value going from A to B over time, on a curve
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback will let you update a TMP text value over time, with a long value going from A to B over time, on a curve")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Count To Long")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPCountToLong : MMF_Feedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
/// the duration of this feedback is the duration of the scale animation
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("TextMeshPro Target Text", true, 12, true)]
/// the target TMP_Text component we want to change the text on
[Tooltip("the target TMP_Text component we want to change the text on")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Count Settings", true, 13)]
/// the value from which to count from
[Tooltip("the value from which to count from")]
public long CountFrom = 0;
/// the value to count towards
[Tooltip("the value to count towards")]
public long CountTo = 100000001;
/// the curve on which to animate the count
[Tooltip("the curve on which to animate the count")]
public MMTweenType CountingCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1f)));
/// the duration of the count, in seconds
[Tooltip("the duration of the count, in seconds")]
public float Duration = 5f;
/// the format with which to display the count
[Tooltip("the format with which to display the count")]
public string Format = "00.00";
/// the minimum frequency (in seconds) at which to refresh the text field
[Tooltip("the minimum frequency (in seconds) at which to refresh the text field")]
public float MinRefreshFrequency = 0f;
protected string _newText;
protected float _startTime;
protected float _lastRefreshAt;
protected string _initialText;
protected Coroutine _coroutine;
/// <summary>
/// On play we change the text of our target TMPText over time
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
_initialText = TargetTMPText.text;
#endif
_coroutine = Owner.StartCoroutine(CountCo());
}
/// <summary>
/// A coroutine used to animate the text
/// </summary>
/// <returns></returns>
protected virtual IEnumerator CountCo()
{
IsPlaying = true;
_lastRefreshAt = -float.MaxValue;
long currentValue = CountFrom;
_startTime = FeedbackTime;
while (FeedbackTime - _startTime <= Duration)
{
if (FeedbackTime - _lastRefreshAt >= MinRefreshFrequency)
{
currentValue = ProcessCount();
UpdateText(currentValue);
_lastRefreshAt = FeedbackTime;
}
yield return null;
}
UpdateText(CountTo);
IsPlaying = false;
}
/// <summary>
/// Updates the text of the target TMPText component with the updated value
/// </summary>
/// <param name="currentValue"></param>
protected virtual void UpdateText(long currentValue)
{
_newText = currentValue.ToString(Format);
#if MM_UGUI2
TargetTMPText.text = _newText;
#endif
}
/// <summary>
/// Computes the new value of the count for the current time
/// </summary>
/// <param name="currentValue"></param>
/// <returns></returns>
protected virtual long ProcessCount()
{
float currentTime = FeedbackTime - _startTime;
return MMTween.Tween(currentTime, 0f, Duration, CountFrom, CountTo, CountingCurve);
}
/// <summary>
/// On stop, we interrupt counting if it was active
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized || (_coroutine == null))
{
return;
}
IsPlaying = false;
Owner.StopCoroutine(_coroutine);
_coroutine = null;
}
/// <summary>
/// On restore, we put our object back at its initial position
/// </summary>
protected override void CustomRestoreInitialValues()
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
TargetTMPText.text = _initialText;
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 9276c6165f72f7046bb1a60b59461c8c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPCountToLong.cs
uploadId: 830868

View File

@@ -0,0 +1,235 @@
using MoreMountains.Tools;
using UnityEngine;
using System.Collections;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you dilate a TMP text over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you dilate a TMP text over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Dilate")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPDilate : MMF_Feedback
{
/// a static bool used to disable all feedbacks of this type at o
public static bool FeedbackTypeAuthorized = true;
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
public override bool HasCustomInspectors => true;
/// the duration of this feedback is the duration of the transition, or 0 if instant
public override float FeedbackDuration { get { return (Mode == MMFeedbackBase.Modes.Instant) ? 0f : ApplyTimeMultiplier(Duration); } set { Duration = value; } }
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip("the TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Dilate", true, 16)]
/// whether or not values should be relative
[Tooltip("whether or not values should be relative")]
public bool RelativeValues = true;
/// the selected mode
[Tooltip("the selected mode")]
public MMFeedbackBase.Modes Mode = MMFeedbackBase.Modes.OverTime;
/// the duration of the feedback, in seconds
[Tooltip("the duration of the feedback, in seconds")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float Duration = 0.5f;
/// the curve to tween on
[Tooltip("the curve to tween on")]
public MMTweenType DilateCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0.5f), new Keyframe(0.3f, 1f), new Keyframe(1, 0.5f)), "", "Mode", (int)MMFeedbackBase.Modes.OverTime);
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapZero = -1f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapOne = 1f;
/// the value to move to in instant mode
[Tooltip("the value to move to in instant mode")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.Instant)]
public float InstantDilate;
/// if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over
[Tooltip("if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over")]
public bool AllowAdditivePlays = false;
protected float _initialDilate;
protected Coroutine _coroutine;
/// <summary>
/// On init we grab our initial dilate value
/// </summary>
/// <param name="owner"></param>
protected override void CustomInitialization(MMF_Player owner)
{
base.CustomInitialization(owner);
if (!Active)
{
return;
}
#if MM_UGUI2
if (TargetTMPText == null)
{
Debug.LogWarning("[TMP Dilate Feedback] The TMP Dilate feedback on "+Owner.name+" doesn't have a TargetTMPText, it won't work. You need to specify one in its inspector.");
return;
}
_initialDilate = TargetTMPText.fontMaterial.GetFloat(ShaderUtilities.ID_FaceDilate);
#endif
}
/// <summary>
/// On Play we turn animate our transition
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
if (Active)
{
switch (Mode)
{
case MMFeedbackBase.Modes.Instant:
float newDilate = NormalPlayDirection ? InstantDilate : _initialDilate;
TargetTMPText.fontMaterial.SetFloat(ShaderUtilities.ID_FaceDilate, newDilate);
TargetTMPText.UpdateMeshPadding();
break;
case MMFeedbackBase.Modes.OverTime:
if (!AllowAdditivePlays && (_coroutine != null))
{
return;
}
if (_coroutine != null) { Owner.StopCoroutine(_coroutine); }
_coroutine = Owner.StartCoroutine(ApplyValueOverTime());
break;
}
}
#endif
}
/// <summary>
/// Applies our dilate value over time
/// </summary>
/// <returns></returns>
protected virtual IEnumerator ApplyValueOverTime()
{
float journey = NormalPlayDirection ? 0f : FeedbackDuration;
IsPlaying = true;
while ((journey >= 0) && (journey <= FeedbackDuration) && (FeedbackDuration > 0))
{
float remappedTime = MMFeedbacksHelpers.Remap(journey, 0f, FeedbackDuration, 0f, 1f);
SetValue(remappedTime);
journey += NormalPlayDirection ? FeedbackDeltaTime : -FeedbackDeltaTime;
yield return null;
}
SetValue(FinalNormalizedTime);
_coroutine = null;
IsPlaying = false;
yield return null;
}
/// <summary>
/// Sets the Dilate value
/// </summary>
/// <param name="time"></param>
protected virtual void SetValue(float time)
{
#if MM_UGUI2
float intensity = MMTween.Tween(time, 0f, 1f, RemapZero, RemapOne, DilateCurve);
float newValue = intensity;
if (RelativeValues)
{
newValue += _initialDilate;
}
TargetTMPText.fontMaterial.SetFloat(ShaderUtilities.ID_FaceDilate, newValue);
TargetTMPText.UpdateMeshPadding();
#endif
}
/// <summary>
/// Stops the animation if needed
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
IsPlaying = false;
if (_coroutine != null)
{
Owner.StopCoroutine(_coroutine);
_coroutine = null;
}
}
/// <summary>
/// On restore, we put our object back at its initial position
/// </summary>
protected override void CustomRestoreInitialValues()
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
TargetTMPText.fontMaterial.SetFloat(ShaderUtilities.ID_FaceDilate, _initialDilate);
TargetTMPText.UpdateMeshPadding();
#endif
}
/// <summary>
/// On Validate, we init our curves conditions if needed
/// </summary>
public override void OnValidate()
{
base.OnValidate();
if (string.IsNullOrEmpty(DilateCurve.EnumConditionPropertyName))
{
DilateCurve.EnumConditionPropertyName = "Mode";
DilateCurve.EnumConditions = new bool[32];
DilateCurve.EnumConditions[(int)MMFeedbackBase.Modes.OverTime] = true;
}
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: ce42aabd176ab5e4d8ba2a0dc416e78e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPDilate.cs
uploadId: 830868

View File

@@ -0,0 +1,106 @@
using MoreMountains.Tools;
using UnityEngine;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you control the font size of a target TMP over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you control the font size of a target TMP over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Font Size")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPFontSize : MMF_FeedbackBase
{
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor
{
get { return MMFeedbacksInspectorColors.TMPColor; }
}
public override string RequiresSetupText
{
get
{
return
"This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below.";
}
}
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup()
{
return (TargetTMPText == null);
}
public override string RequiredTargetText
{
get { return TargetTMPText != null ? TargetTMPText.name : ""; }
}
#endif
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
public override bool CanForceInitialValue => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip("the TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Font Size", true, 16)]
/// the curve to tween on
[Tooltip("the curve to tween on")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime, (int)Modes.ToDestination)]
public MMTweenType FontSizeCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")] [MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")] [MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapOne = 1f;
/// the value to move to in instant mode
[Tooltip("the value to move to in instant mode")] [MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.Instant)]
public float InstantFontSize;
/// the value to move to in destination mode
[Tooltip("the value to move to in destination mode")]
[MMFEnumCondition("Mode", (int)Modes.ToDestination)]
public float DestinationFontSize;
protected override void FillTargets()
{
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
MMF_FeedbackBaseTarget target = new MMF_FeedbackBaseTarget();
MMPropertyReceiver receiver = new MMPropertyReceiver();
receiver.TargetObject = TargetTMPText.gameObject;
receiver.TargetComponent = TargetTMPText;
receiver.TargetPropertyName = "fontSize";
receiver.RelativeValue = RelativeValues;
target.Target = receiver;
target.LevelCurve = FontSizeCurve;
target.RemapLevelZero = RemapZero;
target.RemapLevelOne = RemapOne;
target.InstantLevel = InstantFontSize;
target.ToDestinationLevel = DestinationFontSize;
_targets.Add(target);
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 0fffa36c603d1bd4ea253a17e4d17757
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPFontSize.cs
uploadId: 830868

View File

@@ -0,0 +1,92 @@
using MoreMountains.Tools;
using UnityEngine;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
using UnityEngine.Serialization;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you control the line spacing of a target TMP over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you control the line spacing of a target TMP over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Line Spacing")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPLineSpacing : MMF_FeedbackBase
{
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
public override bool CanForceInitialValue => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip("the TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Paragraph Spacing", true, 37)]
/// the curve to tween on
[Tooltip("the curve to tween on")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime, (int)Modes.ToDestination)]
public MMTweenType LineSpacingCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapOne = 10f;
/// the value to move to in instant mode
[Tooltip("the value to move to in instant mode")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.Instant)]
public float InstantLineSpacing;
/// the value to move to in destination mode
[Tooltip("the value to move to in destination mode")]
[MMFEnumCondition("Mode", (int)Modes.ToDestination)]
public float DestinationLineSpacing;
protected override void FillTargets()
{
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
MMF_FeedbackBaseTarget target = new MMF_FeedbackBaseTarget();
MMPropertyReceiver receiver = new MMPropertyReceiver();
receiver.TargetObject = TargetTMPText.gameObject;
receiver.TargetComponent = TargetTMPText;
receiver.TargetPropertyName = "lineSpacing";
receiver.RelativeValue = RelativeValues;
target.Target = receiver;
target.LevelCurve = LineSpacingCurve;
target.RemapLevelZero = RemapZero;
target.RemapLevelOne = RemapOne;
target.InstantLevel = InstantLineSpacing;
target.ToDestinationLevel = DestinationLineSpacing;
_targets.Add(target);
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 769890c09f9abdf42af40a0e8b1f8ea0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPLineSpacing.cs
uploadId: 830868

View File

@@ -0,0 +1,228 @@
using UnityEngine;
using System.Collections;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you control the color of a target TMP's outline over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you control the color of a target TMP's outline over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Outline Color")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPOutlineColor : MMF_Feedback
{
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
public enum ColorModes { Instant, Gradient, Interpolate }
/// the duration of this feedback is the duration of the color transition, or 0 if instant
public override float FeedbackDuration { get { return (ColorMode == ColorModes.Instant) ? 0f : ApplyTimeMultiplier(Duration); } set { Duration = value; } }
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip("the TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Outline Color", true, 16)]
/// the selected color mode :
/// None : nothing will happen,
/// gradient : evaluates the color over time on that gradient, from left to right,
/// interpolate : lerps from the current color to the destination one
[Tooltip("the selected color mode :" +
"None : nothing will happen," +
"gradient : evaluates the color over time on that gradient, from left to right," +
"interpolate : lerps from the current color to the destination one ")]
public ColorModes ColorMode = ColorModes.Interpolate;
/// how long the color of the text should change over time
[Tooltip("how long the color of the text should change over time")]
[MMFEnumCondition("ColorMode", (int)ColorModes.Interpolate, (int)ColorModes.Gradient)]
public float Duration = 0.2f;
/// the color to apply
[Tooltip("the color to apply")]
[MMFEnumCondition("ColorMode", (int)ColorModes.Instant)]
public Color32 InstantColor = Color.yellow;
/// the gradient to use to animate the color over time
[Tooltip("the gradient to use to animate the color over time")]
[MMFEnumCondition("ColorMode", (int)ColorModes.Gradient)]
[GradientUsage(true)]
public Gradient ColorGradient;
/// the destination color when in interpolate mode
[Tooltip("the destination color when in interpolate mode")]
[MMFEnumCondition("ColorMode", (int)ColorModes.Interpolate)]
public Color32 DestinationColor = Color.yellow;
/// the curve to use when interpolating towards the destination color
[Tooltip("the curve to use when interpolating towards the destination color")]
[MMFEnumCondition("ColorMode", (int)ColorModes.Interpolate)]
public AnimationCurve ColorCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over
[Tooltip("if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over")]
public bool AllowAdditivePlays = false;
protected Color _initialColor;
protected Coroutine _coroutine;
/// <summary>
/// On init we store our initial outline color
/// </summary>
/// <param name="owner"></param>
protected override void CustomInitialization(MMF_Player owner)
{
base.CustomInitialization(owner);
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
_initialColor = TargetTMPText.outlineColor;
#endif
}
/// <summary>
/// On Play we change our text's outline's color
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
switch (ColorMode)
{
case ColorModes.Instant:
TargetTMPText.outlineColor = NormalPlayDirection ? InstantColor : _initialColor;
break;
case ColorModes.Gradient:
if (!AllowAdditivePlays && (_coroutine != null))
{
return;
}
if (_coroutine != null) { Owner.StopCoroutine(_coroutine); }
_coroutine = Owner.StartCoroutine(ChangeColor());
break;
case ColorModes.Interpolate:
if (!AllowAdditivePlays && (_coroutine != null))
{
return;
}
if (_coroutine != null) { Owner.StopCoroutine(_coroutine); }
_coroutine = Owner.StartCoroutine(ChangeColor());
break;
}
#endif
}
/// <summary>
/// Changes the color of the text's outline over time
/// </summary>
/// <returns></returns>
protected virtual IEnumerator ChangeColor()
{
IsPlaying = true;
float journey = NormalPlayDirection ? 0f : FeedbackDuration;
while ((journey >= 0) && (journey <= FeedbackDuration) && (FeedbackDuration > 0))
{
float remappedTime = MMFeedbacksHelpers.Remap(journey, 0f, FeedbackDuration, 0f, 1f);
SetColor(remappedTime);
journey += NormalPlayDirection ? FeedbackDeltaTime : -FeedbackDeltaTime;
yield return null;
}
SetColor(FinalNormalizedTime);
_coroutine = null;
IsPlaying = false;
yield break;
}
/// <summary>
/// Applies the color change
/// </summary>
/// <param name="time"></param>
protected virtual void SetColor(float time)
{
#if MM_UGUI2
if (ColorMode == ColorModes.Gradient)
{
// we set our object inactive then active, otherwise for some reason outline color isn't applied.
TargetTMPText.gameObject.SetActive(false);
TargetTMPText.outlineColor = ColorGradient.Evaluate(time);
TargetTMPText.gameObject.SetActive(true);
}
else if (ColorMode == ColorModes.Interpolate)
{
float factor = ColorCurve.Evaluate(time);
TargetTMPText.gameObject.SetActive(false);
TargetTMPText.outlineColor = Color.LerpUnclamped(_initialColor, DestinationColor, factor);
TargetTMPText.gameObject.SetActive(true);
}
#endif
}
/// <summary>
/// Stops the animation if needed
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
IsPlaying = false;
if (_coroutine != null)
{
Owner.StopCoroutine(_coroutine);
_coroutine = null;
}
}
/// <summary>
/// On restore, we put our object back at its initial position
/// </summary>
protected override void CustomRestoreInitialValues()
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
TargetTMPText.gameObject.SetActive(false);
TargetTMPText.outlineColor = _initialColor;
TargetTMPText.gameObject.SetActive(true);
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: e39702c3d8077294887f6c1ddec28589
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPOutlineColor.cs
uploadId: 830868

View File

@@ -0,0 +1,98 @@
using MoreMountains.Tools;
using UnityEngine;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you control the outline width of a target TMP over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you control the outline width of a target TMP over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Outline Width")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPOutlineWidth : MMF_FeedbackBase
{
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor
{
get { return MMFeedbacksInspectorColors.TMPColor; }
}
public override string RequiresSetupText
{
get
{
return
"This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below.";
}
}
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
public override bool CanForceInitialValue => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip("the TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Outline Width", true, 22)]
/// the curve to tween on
[Tooltip("the curve to tween on")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime, (int)Modes.ToDestination)]
public MMTweenType OutlineWidthCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")] [MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")] [MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapOne = 1f;
/// the value to move to in instant mode
[Tooltip("the value to move to in instant mode")] [MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.Instant)]
public float InstantOutlineWidth;
/// the value to move to in destination mode
[Tooltip("the value to move to in destination mode")]
[MMFEnumCondition("Mode", (int)Modes.ToDestination)]
public float DestinationOutlineWidth;
protected override void FillTargets()
{
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
MMF_FeedbackBaseTarget target = new MMF_FeedbackBaseTarget();
MMPropertyReceiver receiver = new MMPropertyReceiver();
receiver.TargetObject = TargetTMPText.gameObject;
receiver.TargetComponent = TargetTMPText;
receiver.TargetPropertyName = "outlineWidth";
receiver.RelativeValue = RelativeValues;
target.Target = receiver;
target.LevelCurve = OutlineWidthCurve;
target.RemapLevelZero = RemapZero;
target.RemapLevelOne = RemapOne;
target.InstantLevel = InstantOutlineWidth;
target.ToDestinationLevel = DestinationOutlineWidth;
_targets.Add(target);
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 932d7950b01edc04d8d29d2669394cf5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPOutlineWidth.cs
uploadId: 830868

View File

@@ -0,0 +1,92 @@
using MoreMountains.Tools;
using UnityEngine;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
using UnityEngine.Serialization;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you control the paragraph spacing of a target TMP over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you control the paragraph spacing of a target TMP over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Paragraph Spacing")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPParagraphSpacing : MMF_FeedbackBase
{
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
public override bool CanForceInitialValue => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip("the TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Paragraph Spacing", true, 21)]
/// the curve to tween on
[Tooltip("the curve to tween on")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime, (int)Modes.ToDestination)]
public MMTweenType ParagraphSpacingCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapOne = 10f;
/// the value to move to in instant mode
[Tooltip("the value to move to in instant mode")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.Instant)]
public float InstantParagraphSpacing;
/// the value to move to in destination mode
[Tooltip("the value to move to in destination mode")]
[MMFEnumCondition("Mode", (int)Modes.ToDestination)]
public float DestinationParagraphSpacing;
protected override void FillTargets()
{
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
MMF_FeedbackBaseTarget target = new MMF_FeedbackBaseTarget();
MMPropertyReceiver receiver = new MMPropertyReceiver();
receiver.TargetObject = TargetTMPText.gameObject;
receiver.TargetComponent = TargetTMPText;
receiver.TargetPropertyName = "paragraphSpacing";
receiver.RelativeValue = RelativeValues;
target.Target = receiver;
target.LevelCurve = ParagraphSpacingCurve;
target.RemapLevelZero = RemapZero;
target.RemapLevelOne = RemapOne;
target.InstantLevel = InstantParagraphSpacing;
target.ToDestinationLevel = DestinationParagraphSpacing;
_targets.Add(target);
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 0be258710b59b254097822aef1c6820e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPParagraphSpacing.cs
uploadId: 830868

View File

@@ -0,0 +1,222 @@
using MoreMountains.Tools;
using UnityEngine;
using System.Collections;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you tweak the softness of a TMP text over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you tweak the softness of a TMP text over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Softness")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPSoftness : MMF_Feedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
public override bool HasCustomInspectors => true;
/// the duration of this feedback is the duration of the transition, or 0 if instant
public override float FeedbackDuration { get { return (Mode == MMFeedbackBase.Modes.Instant) ? 0f : ApplyTimeMultiplier(Duration); } set { Duration = value; } }
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip("the TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Softness", true, 13)]
/// whether or not values should be relative
[Tooltip("whether or not values should be relative")]
public bool RelativeValues = true;
/// the selected mode
[Tooltip("the selected mode")]
public MMFeedbackBase.Modes Mode = MMFeedbackBase.Modes.OverTime;
/// the duration of the feedback, in seconds
[Tooltip("the duration of the feedback, in seconds")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float Duration = 0.5f;
/// the curve to tween on
[Tooltip("the curve to tween on")]
public MMTweenType SoftnessCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0f), new Keyframe(0.3f, 1f), new Keyframe(1, 0f)), "", "Mode", (int)MMFeedbackBase.Modes.OverTime);
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapOne = 1f;
/// the value to move to in instant mode
[Tooltip("the value to move to in instant mode")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.Instant)]
public float InstantSoftness;
/// if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over
[Tooltip("if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over")]
public bool AllowAdditivePlays = false;
protected float _initialSoftness;
protected Coroutine _coroutine;
/// <summary>
/// On init we grab our initial softness
/// </summary>
/// <param name="owner"></param>
protected override void CustomInitialization(MMF_Player owner)
{
base.CustomInitialization(owner);
if (!Active)
{
return;
}
#if MM_UGUI2
if (TargetTMPText == null)
{
Debug.LogWarning("[TMP Softness Feedback] The TMP Softness feedback on "+Owner.name+" doesn't have a TargetTMPText, it won't work. You need to specify one in its inspector.");
return;
}
_initialSoftness = TargetTMPText.fontMaterial.GetFloat(ShaderUtilities.ID_OutlineSoftness);
#endif
}
/// <summary>
/// On Play we animate our softness
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
if (Active && FeedbackTypeAuthorized)
{
switch (Mode)
{
case MMFeedbackBase.Modes.Instant:
float newSoftness = NormalPlayDirection ? InstantSoftness : _initialSoftness;
TargetTMPText.fontMaterial.SetFloat(ShaderUtilities.ID_OutlineSoftness, InstantSoftness);
TargetTMPText.UpdateMeshPadding();
break;
case MMFeedbackBase.Modes.OverTime:
if (!AllowAdditivePlays && (_coroutine != null))
{
return;
}
if (_coroutine != null) { Owner.StopCoroutine(_coroutine); }
_coroutine = Owner.StartCoroutine(ApplyValueOverTime());
break;
}
}
#endif
}
/// <summary>
/// Stops the animation if needed
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
IsPlaying = false;
if (_coroutine != null)
{
Owner.StopCoroutine(_coroutine);
_coroutine = null;
}
}
protected virtual IEnumerator ApplyValueOverTime()
{
float journey = NormalPlayDirection ? 0f : FeedbackDuration;
IsPlaying = true;
while ((journey >= 0) && (journey <= FeedbackDuration) && (FeedbackDuration > 0))
{
float remappedTime = MMFeedbacksHelpers.Remap(journey, 0f, FeedbackDuration, 0f, 1f);
SetValue(remappedTime);
journey += NormalPlayDirection ? FeedbackDeltaTime : -FeedbackDeltaTime;
yield return null;
}
SetValue(FinalNormalizedTime);
_coroutine = null;
IsPlaying = false;
yield return null;
}
protected virtual void SetValue(float time)
{
#if MM_UGUI2
float intensity = MMTween.Tween(time, 0f, 1f, RemapZero, RemapOne, SoftnessCurve);
float newValue = intensity;
if (RelativeValues)
{
newValue += _initialSoftness;
}
TargetTMPText.fontMaterial.SetFloat(ShaderUtilities.ID_OutlineSoftness, newValue);
TargetTMPText.UpdateMeshPadding();
#endif
}
/// <summary>
/// On restore, we put our object back at its initial position
/// </summary>
protected override void CustomRestoreInitialValues()
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
TargetTMPText.fontMaterial.SetFloat(ShaderUtilities.ID_OutlineSoftness, _initialSoftness);
TargetTMPText.UpdateMeshPadding();
#endif
}
/// <summary>
/// On Validate, we init our curves conditions if needed
/// </summary>
public override void OnValidate()
{
base.OnValidate();
if (string.IsNullOrEmpty(SoftnessCurve.EnumConditionPropertyName))
{
SoftnessCurve.EnumConditionPropertyName = "Mode";
SoftnessCurve.EnumConditions = new bool[32];
SoftnessCurve.EnumConditions[(int)MMFeedbackBase.Modes.OverTime] = true;
}
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: ef0aa39dbc6e77a4492bee30af779378
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPSoftness.cs
uploadId: 830868

View File

@@ -0,0 +1,84 @@
using UnityEngine;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback will let you change the text of a target TMP text component
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback will let you change the text of a target TMP text component")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Text")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPText : MMF_Feedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("TextMeshPro Change Text", true, 12, true)]
/// the target TMP_Text component we want to change the text on
[Tooltip("the target TMP_Text component we want to change the text on")]
public TMP_Text TargetTMPText;
/// the new text to replace the old one with
[Tooltip("the new text to replace the old one with")]
[TextArea]
public string NewText = "Hello World";
#endif
protected string _initialText;
/// <summary>
/// On play we change the text of our target TMPText
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
#if MM_UGUI2
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
if (TargetTMPText == null)
{
return;
}
_initialText = TargetTMPText.text;
TargetTMPText.text = NewText;
#endif
}
/// <summary>
/// On restore, we put our object back at its initial position
/// </summary>
protected override void CustomRestoreInitialValues()
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
TargetTMPText.text = _initialText;
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: c3085c8741c1bb84ca7a609f2989b7e0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPText.cs
uploadId: 830868

View File

@@ -0,0 +1,561 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEngine.Events;
#if MM_UGUI2
using MoreMountains.Tools;
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback will let you reveal words, lines, or characters in a target TMP, one at a time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback will let you reveal words, lines, or characters in a target TMP, one at a time")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Text Reveal")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPTextReveal : MMF_Feedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
protected string _originalText;
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
protected TMP_TextInfo _textInfo;
/// the duration of this feedback
public override float FeedbackDuration
{
get
{
if (DurationMode == DurationModes.TotalDuration)
{
return RevealDuration;
}
else
{
if (TargetTMPText == null)
{
return 0f;
}
if (TargetTMPText.textInfo == null)
{
bool initiallyActive = TargetTMPText.gameObject.activeSelf;
TargetTMPText.gameObject.SetActive(true);
TargetTMPText.ForceMeshUpdate(true);
TargetTMPText.gameObject.SetActive(initiallyActive);
}
if (AllowHierarchyActivationForDurationComputation)
{
List<Transform> disabledParents = TargetTMPText.transform.MMEnumerateAllParents(true).Where(p => !p.gameObject.activeSelf).ToList();
disabledParents.ForEach(p => p.gameObject.SetActive(true));
TargetTMPText.ForceMeshUpdate(true);
disabledParents.ForEach(p => p.gameObject.SetActive(false));
}
if (TargetTMPText.textInfo == null)
{
return 0f;
}
float foundLength = 0f;
if (ReplaceText)
{
_originalText = TargetTMPText.text;
TargetTMPText.text = NewText;
}
switch (RevealMode)
{
case RevealModes.Character:
foundLength = RichTextLength(TargetTMPText.text) * IntervalBetweenReveals;
break;
case RevealModes.Lines:
foundLength = TargetTMPText.textInfo.lineCount * IntervalBetweenReveals;
break;
case RevealModes.Words:
foundLength = TargetTMPText.textInfo.wordCount * IntervalBetweenReveals;
break;
}
if (ReplaceText)
{
TargetTMPText.text = _originalText;
}
return foundLength;
}
}
set
{
if (DurationMode == DurationModes.TotalDuration)
{
RevealDuration = value;
if (TargetTMPText != null)
{
if (ReplaceText)
{
_originalText = TargetTMPText.text;
TargetTMPText.text = NewText;
}
switch (RevealMode)
{
case RevealModes.Character:
IntervalBetweenReveals = value / RichTextLength(TargetTMPText.text);
break;
case RevealModes.Lines:
IntervalBetweenReveals = value / TargetTMPText.textInfo.lineCount;
break;
case RevealModes.Words:
IntervalBetweenReveals = value / TargetTMPText.textInfo.wordCount;
break;
}
if (ReplaceText)
{
TargetTMPText.text = _originalText;
}
}
}
else
{
if (TargetTMPText != null)
{
if (ReplaceText)
{
_originalText = TargetTMPText.text;
TargetTMPText.text = NewText;
}
switch (RevealMode)
{
case RevealModes.Character:
IntervalBetweenReveals = value / RichTextLength(TargetTMPText.text);
break;
case RevealModes.Lines:
IntervalBetweenReveals = value / TargetTMPText.textInfo.lineCount;
break;
case RevealModes.Words:
IntervalBetweenReveals = value / TargetTMPText.textInfo.wordCount;
break;
}
if (ReplaceText)
{
TargetTMPText.text = _originalText;
}
}
}
}
}
#endif
/// the possible ways to reveal the text
public enum RevealModes { Character, Lines, Words }
/// whether to define duration by the time interval between two unit reveals, or by the total duration the reveal should take
public enum DurationModes { Interval, TotalDuration }
#if MM_UGUI2
[MMFInspectorGroup("Target", true, 12, true)]
/// the target TMP_Text component we want to change the text on
[Tooltip("the target TMP_Text component we want to change the text on")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Change Text", true, 13)]
/// whether or not to replace the current TMP target's text on play
[Tooltip("whether or not to replace the current TMP target's text on play")]
public bool ReplaceText = false;
/// if this is true, the maxVisible Characters/Lines/Words will be set to 0 on initialization
[Tooltip("if this is true, the maxVisible Characters/Lines/Words will be set to 0 on initialization")]
public bool HideTextOnInitialization = false;
/// the new text to replace the old one with
[Tooltip("the new text to replace the old one with")]
[TextArea]
public string NewText = "Hello World";
[MMFInspectorGroup("Reveal", true, 14)]
/// the selected way to reveal the text (character by character, word by word, or line by line)
[Tooltip("the selected way to reveal the text (character by character, word by word, or line by line)")]
public RevealModes RevealMode = RevealModes.Character;
/// whether to define duration by the time interval between two unit reveals, or by the total duration the reveal should take
[Tooltip("whether to define duration by the time interval between two unit reveals, or by the total duration the reveal should take")]
public DurationModes DurationMode = DurationModes.Interval;
/// the interval (in seconds) between two reveals
[Tooltip("the interval (in seconds) between two reveals")]
[MMFEnumCondition("DurationMode", (int)DurationModes.Interval)]
public float IntervalBetweenReveals = 0.05f;
/// the total duration of the text reveal, in seconds
[Tooltip("the total duration of the text reveal, in seconds")]
[MMFEnumCondition("DurationMode", (int)DurationModes.TotalDuration)]
public float RevealDuration = 1f;
/// a UnityEvent to invoke every time a reveal happens (word, line or character)
[Tooltip("a UnityEvent to invoke every time a reveal happens (word, line or character)")]
public UnityEvent OnReveal;
/// alright so that one will be weird : for reasons, TextMeshPro won't let you read the length of a disabled text, so to do so, we need to enable it, even if it's just to disable it again right after. If you're targeting a disabled text, or a text that is part of a disabled hierarchy, you'll probably want to set this to true so that the system can proceed with accurate duration computation. If you don't, and your target transform is disabled, duration won't be computed correctly.
[Tooltip("alright so that one will be weird : for reasons, TextMeshPro won't let you read the length of a disabled text, so to do so, we need to enable it, even if it's just to disable it again right after. If you're targeting a disabled text, or a text that is part of a disabled hierarchy, you'll probably want to set this to true so that the system can proceed with accurate duration computation. If you don't, and your target transform is disabled, duration won't be computed correctly.")]
public bool AllowHierarchyActivationForDurationComputation = false;
protected float _delay;
protected Coroutine _coroutine;
protected int _richTextLength;
protected int _totalCharacters;
protected int _totalLines;
protected int _totalWords;
protected string _initialText;
protected int _indexLastTime = -1;
/// <summary>
/// Sets the maximum amount of visible characters/words/lines to 0 if needed
/// </summary>
/// <param name="owner"></param>
protected override void CustomInitialization(MMF_Player owner)
{
base.CustomInitialization(owner);
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
if (HideTextOnInitialization)
{
switch (RevealMode)
{
case RevealModes.Character:
TargetTMPText.maxVisibleCharacters = 0;
break;
case RevealModes.Lines:
TargetTMPText.maxVisibleLines = 0;
break;
case RevealModes.Words:
TargetTMPText.maxVisibleWords = 0;
break;
}
}
#endif
}
/// <summary>
/// On play we change the text of our target TMPText
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
if (DurationMode == DurationModes.TotalDuration)
{
FeedbackDuration = RevealDuration;
}
_initialText = TargetTMPText.text;
_textInfo = TargetTMPText.textInfo;
if (ReplaceText)
{
TargetTMPText.text = NewText;
TargetTMPText.ForceMeshUpdate();
}
_richTextLength = RichTextLength(TargetTMPText.text);
if (_coroutine != null) { Owner.StopCoroutine(_coroutine); }
switch (RevealMode)
{
case RevealModes.Character:
_delay = (DurationMode == DurationModes.Interval) ? IntervalBetweenReveals : RevealDuration / _richTextLength;
TargetTMPText.maxVisibleCharacters = 0;
_coroutine = Owner.StartCoroutine(RevealCharacters());
break;
case RevealModes.Lines:
_delay = (DurationMode == DurationModes.Interval) ? IntervalBetweenReveals : RevealDuration / TargetTMPText.textInfo.lineCount;
TargetTMPText.maxVisibleLines = 0;
_coroutine = Owner.StartCoroutine(RevealLines());
break;
case RevealModes.Words:
_delay = (DurationMode == DurationModes.Interval) ? IntervalBetweenReveals : RevealDuration / TargetTMPText.textInfo.wordCount;
TargetTMPText.maxVisibleWords = 0;
_coroutine = Owner.StartCoroutine(RevealWords());
break;
}
#endif
}
#if MM_UGUI2
/// <summary>
/// Reveals characters one at a time
/// </summary>
/// <returns></returns>
protected virtual IEnumerator RevealCharacters()
{
float startTime = FeedbackTime;
_totalCharacters = _richTextLength;
int visibleCharacters = 0;
IsPlaying = true;
TargetTMPText.maxVisibleCharacters = 0;
while ((visibleCharacters < _totalCharacters) && !Owner.SkippingToTheEnd)
{
float currentTime = FeedbackTime;
float elapsed = currentTime - startTime;
int expectedVisibleCharacters = 0;
if (DurationMode == DurationModes.Interval)
{
expectedVisibleCharacters = Mathf.FloorToInt(elapsed / IntervalBetweenReveals);
}
else
{
expectedVisibleCharacters = Mathf.FloorToInt((_totalCharacters * elapsed) / RevealDuration);
}
expectedVisibleCharacters = Mathf.Clamp(expectedVisibleCharacters, 0, _totalCharacters);
if (expectedVisibleCharacters > visibleCharacters)
{
visibleCharacters = expectedVisibleCharacters;
TargetTMPText.maxVisibleCharacters = visibleCharacters;
InvokeRevealEvents();
}
yield return null;
}
TargetTMPText.maxVisibleCharacters = _richTextLength;
IsPlaying = false;
}
/// <summary>
/// Reveals lines one at a time
/// </summary>
/// <returns></returns>
protected virtual IEnumerator RevealLines()
{
_totalLines = TargetTMPText.textInfo.lineCount;
int visibleLines = 0;
IsPlaying = true;
while ((visibleLines <= _totalLines) && !Owner.SkippingToTheEnd)
{
TargetTMPText.maxVisibleLines = visibleLines;
InvokeRevealEvents();
visibleLines++;
yield return WaitFor(_delay);
}
TargetTMPText.maxVisibleLines = _totalLines;
IsPlaying = false;
}
/// <summary>
/// Reveals words one at a time
/// </summary>
/// <returns></returns>
protected virtual IEnumerator RevealWords()
{
_totalWords = TargetTMPText.textInfo.wordCount;
int visibleWords = 0;
IsPlaying = true;
while ((visibleWords <= _totalWords) && !Owner.SkippingToTheEnd)
{
TargetTMPText.maxVisibleWords = visibleWords;
InvokeRevealEvents();
visibleWords++;
yield return WaitFor(_delay);
}
TargetTMPText.maxVisibleWords = _totalWords;
IsPlaying = false;
}
/// <summary>
/// Invokes on reveal events
/// </summary>
protected virtual void InvokeRevealEvents()
{
if ( ((RevealMode == RevealModes.Character) && (TargetTMPText.maxVisibleCharacters == 0))
|| ((RevealMode == RevealModes.Character) && !IsNewVisibleCharacter())
|| ((RevealMode == RevealModes.Lines) && (TargetTMPText.maxVisibleLines == 0))
|| ((RevealMode == RevealModes.Words) && (TargetTMPText.maxVisibleWords == 0)) )
{
return;
}
OnReveal?.Invoke();
}
/// <summary>
/// Stops the animation if needed
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
IsPlaying = false;
if (_coroutine != null)
{
Owner.StopCoroutine(_coroutine);
_coroutine = null;
}
}
/// <summary>
/// On skip, we display our entire text
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomSkipToTheEnd(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!IsPlaying)
{
return;
}
switch (RevealMode)
{
case RevealModes.Character:
TargetTMPText.maxVisibleCharacters = _totalCharacters;
break;
case RevealModes.Lines:
TargetTMPText.maxVisibleLines = _totalLines;
break;
case RevealModes.Words:
TargetTMPText.maxVisibleWords = _totalWords;
break;
}
}
/// <summary>
/// Returns the length of a rich text, excluding its tags
/// </summary>
/// <param name="richText"></param>
/// <returns></returns>
protected int RichTextLength(string richText)
{
int richTextLength = 0;
bool insideTag = false;
richText = richText.Replace("<br>", "-");
var tagName = new StringBuilder();
foreach (char character in richText)
{
if (character == '<')
{
insideTag = true;
tagName.Clear();
continue;
}
else if (character == '>')
{
if(tagName.ToString().StartsWith("sprite")) richTextLength++;
insideTag = false;
}
else if (!insideTag)
{
richTextLength++;
}
else
{
tagName.Append(character);
}
}
return richTextLength;
}
/// <summary>
/// Returns true if the last visible letter of the TMP text is new and visible and a letter or digit
/// </summary>
/// <returns></returns>
protected virtual bool IsNewVisibleCharacter()
{
int lastVisibleCharIndex = -1;
_textInfo = TargetTMPText.GetTextInfo(TargetTMPText.text);
for (int i = 0; i < _textInfo.characterCount; i++)
{
if (_textInfo.characterInfo[i].isVisible)
{
lastVisibleCharIndex = i;
}
}
if ((lastVisibleCharIndex < 0)
|| (lastVisibleCharIndex > TargetTMPText.text.Length)
|| (lastVisibleCharIndex == _indexLastTime))
{
return false;
}
_indexLastTime = lastVisibleCharIndex;
return Char.IsLetterOrDigit(_textInfo.characterInfo[lastVisibleCharIndex].character);
}
#endif
/// <summary>
/// On restore, we put our object back at its initial position
/// </summary>
protected override void CustomRestoreInitialValues()
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_UGUI2
TargetTMPText.text = _initialText;
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 45c7b8525ec6efc459e80a97bb09c688
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPTextReveal.cs
uploadId: 830868

View File

@@ -0,0 +1,92 @@
using MoreMountains.Tools;
using UnityEngine;
#if MM_UGUI2
using TMPro;
#endif
using UnityEngine.Scripting.APIUpdating;
using UnityEngine.Serialization;
namespace MoreMountains.Feedbacks
{
/// <summary>
/// This feedback lets you control the word spacing of a target TMP over time
/// </summary>
[AddComponentMenu("")]
[System.Serializable]
[FeedbackHelp("This feedback lets you control the word spacing of a target TMP over time.")]
#if MM_UGUI2
[FeedbackPath("TextMesh Pro/TMP Word Spacing")]
#endif
[MovedFrom(false, null, "MoreMountains.Feedbacks.TextMeshPro")]
public class MMF_TMPWordSpacing : MMF_FeedbackBase
{
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.TMPColor; } }
public override string RequiresSetupText { get { return "This feedback requires that a TargetTMPText be set to be able to work properly. You can set one below."; } }
#endif
#if UNITY_EDITOR && MM_UGUI2
public override bool EvaluateRequiresSetup() { return (TargetTMPText == null); }
public override string RequiredTargetText { get { return TargetTMPText != null ? TargetTMPText.name : ""; } }
#endif
#if MM_UGUI2
public override bool HasAutomatedTargetAcquisition => true;
public override bool CanForceInitialValue => true;
protected override void AutomateTargetAcquisition() => TargetTMPText = FindAutomatedTarget<TMP_Text>();
[MMFInspectorGroup("Target", true, 12, true)]
/// the TMP_Text component to control
[Tooltip("the TMP_Text component to control")]
public TMP_Text TargetTMPText;
#endif
[MMFInspectorGroup("Word Spacing", true, 15)]
/// the curve to tween on
[Tooltip("the curve to tween on")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime, (int)Modes.ToDestination)]
public MMTweenType WordSpacingCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.OverTime)]
public float RemapOne = 10f;
/// the value to move to in instant mode
[Tooltip("the value to move to in instant mode")]
[MMFEnumCondition("Mode", (int)MMFeedbackBase.Modes.Instant)]
public float InstantWordSpacing;
/// the value to move to in destination mode
[Tooltip("the value to move to in destination mode")]
[MMFEnumCondition("Mode", (int)Modes.ToDestination)]
public float DestinationWordSpacing;
protected override void FillTargets()
{
#if MM_UGUI2
if (TargetTMPText == null)
{
return;
}
MMF_FeedbackBaseTarget target = new MMF_FeedbackBaseTarget();
MMPropertyReceiver receiver = new MMPropertyReceiver();
receiver.TargetObject = TargetTMPText.gameObject;
receiver.TargetComponent = TargetTMPText;
receiver.TargetPropertyName = "wordSpacing";
receiver.RelativeValue = RelativeValues;
target.Target = receiver;
target.LevelCurve = WordSpacingCurve;
target.RemapLevelZero = RemapZero;
target.RemapLevelOne = RemapOne;
target.InstantLevel = InstantWordSpacing;
target.ToDestinationLevel = DestinationWordSpacing;
_targets.Add(target);
#endif
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: bfe04c61ac8739b4eb65938198bcc344
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/Feedbacks/MMF_TMPWordSpacing.cs
uploadId: 830868

View File

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

View File

@@ -0,0 +1,58 @@
using UnityEngine;
using MoreMountains.Tools;
#if MM_UGUI2
using TMPro;
#endif
namespace MoreMountains.Feedbacks
{
/// <summary>
/// A floating text variant using TextMeshPro instead of regular TextMesh
/// </summary>
public class MMFloatingTextMeshPro : MMFloatingText
{
#if MM_UGUI2
[Header("TextMeshPro")]
/// the TextMeshPro object to use to display values
public TextMeshPro TargetTextMeshPro;
/// <summary>
/// On init we grab our TMP's color
/// </summary>
protected override void Initialization()
{
base.Initialization();
_initialTextColor = TargetTextMeshPro.color;
}
/// <summary>
/// Sets the TMP's value
/// </summary>
/// <param name="newValue"></param>
public override void SetText(string newValue)
{
TargetTextMeshPro.text = newValue;
}
/// <summary>
/// Sets the color of the target TMP
/// </summary>
/// <param name="newColor"></param>
public override void SetColor(Color newColor)
{
TargetTextMeshPro.color = newColor;
}
/// <summary>
/// Sets the opacity of the target TMP
/// </summary>
/// <param name="newOpacity"></param>
public override void SetOpacity(float newOpacity)
{
_newColor = TargetTextMeshPro.color;
_newColor.a = newOpacity;
TargetTextMeshPro.color = _newColor;
}
#endif
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 2192c456bb84f804aa4b04b6c64a7acb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/MMFloatingText/MMFloatingTextMeshPro.cs
uploadId: 830868

View File

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

View File

@@ -0,0 +1,806 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4206607447451609638
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1390129691196447985}
- component: {fileID: 9212669487376954193}
- component: {fileID: 4791405907307182499}
m_Layer: 0
m_Name: TMP SubMesh [Lato SDF Material + Lato-Bold SDF Atlas]
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1390129691196447985
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4206607447451609638}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 7621044863247771369}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &9212669487376954193
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4206607447451609638}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &4791405907307182499
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4206607447451609638}
m_Mesh: {fileID: 0}
--- !u!1 &7372881786062947483
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3258814973617716309}
m_Layer: 0
m_Name: Billboard
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3258814973617716309
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7372881786062947483}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7621044863247771369}
m_Father: {fileID: 2676981279837942082}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7785295853672088445
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7785295853672088418}
- component: {fileID: 6659172821923877623}
- component: {fileID: 7284800961402381166}
m_Layer: 0
m_Name: MMFloatingTextMeshPro
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7785295853672088418
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7785295853672088445}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 6.93, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2676981279837942082}
- {fileID: 7838352154683608450}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6659172821923877623
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7785295853672088445}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 72de0b0360096ea41a18d17864ecb963, type: 3}
m_Name:
m_EditorClassIdentifier:
BoundsBasedOn: 3
ExecuteOnEnable:
m_PersistentCalls:
m_Calls: []
ExecuteOnDisable:
m_PersistentCalls:
m_Calls: []
LifeTime: 0
--- !u!114 &7284800961402381166
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7785295853672088445}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2192c456bb84f804aa4b04b6c64a7acb, type: 3}
m_Name:
m_EditorClassIdentifier:
MovingPart: {fileID: 2676981279837942082}
Billboard: {fileID: 3258814973617716309}
TargetTextMesh: {fileID: 0}
Direction: {x: 0, y: 1, z: 0}
TargetTextMeshPro: {fileID: 8042657054365514525}
--- !u!1 &8494741392771170296
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2676981279837942082}
m_Layer: 0
m_Name: MovingContainer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2676981279837942082
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8494741392771170296}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3258814973617716309}
m_Father: {fileID: 7785295853672088418}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8563583507991455142
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7838352154683608450}
- component: {fileID: 6466343129216784876}
m_Layer: 0
m_Name: AppearFeedbacks
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7838352154683608450
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8563583507991455142}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 7785295853672088418}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6466343129216784876
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8563583507991455142}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6da43522623d4704e979466dc7650b65, type: 3}
m_Name:
m_EditorClassIdentifier:
Feedbacks:
- {fileID: 0}
InitializationMode: 1
SafeMode: 3
Direction: 0
AutoChangeDirectionOnEnd: 0
AutoPlayOnStart: 0
AutoPlayOnEnable: 1
ForceTimescaleMode: 0
ForcedTimescaleMode: 1
DurationMultiplier: 1
RandomizeDuration: 0
RandomDurationMultiplier: {x: 0.5, y: 1.5}
DisplayFullDurationDetails: 0
PlayerTimescaleMode: 1
OnlyPlayIfWithinRange: 0
RangeCenter: {fileID: 0}
RangeDistance: 5
UseRangeFalloff: 0
RangeFalloff:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
RemapRangeFalloff: {x: 0, y: 1}
IgnoreRangeEvents: 0
CooldownDuration: 0
InitialDelay: 0
CanPlay: 1
CanPlayWhileAlreadyPlaying: 1
ChanceToPlay: 100
FeedbacksIntensity: 1
Events:
TriggerMMFeedbacksEvents: 0
TriggerUnityEvents: 1
OnPlay:
m_PersistentCalls:
m_Calls: []
OnPause:
m_PersistentCalls:
m_Calls: []
OnResume:
m_PersistentCalls:
m_Calls: []
OnRevert:
m_PersistentCalls:
m_Calls: []
OnComplete:
m_PersistentCalls:
m_Calls: []
OnRestoreInitialValues:
m_PersistentCalls:
m_Calls: []
OnSkipToTheEnd:
m_PersistentCalls:
m_Calls: []
DebugActive: 0
FeedbacksList:
- id: 0
KeepPlayModeChanges: 0
PerformanceMode: 0
ForceStopFeedbacksOnDisable: 1
PlayCount: 0
references:
version: 1
00000000:
type: {class: MMF_Scale, ns: MoreMountains.Feedbacks, asm: MoreMountains.Feedbacks}
data:
Active: 0
UniqueID: -129877084
Label: Scale
ChannelMode: 0
Channel: 0
MMChannelDefinition: {fileID: 0}
Chance: 100
DisplayColor: {r: 0, g: 0, b: 0, a: 1}
Timing:
TimescaleMode: 0
ExcludeFromHoldingPauses: 0
ContributeToTotalDuration: 1
InitialDelay: 0
CooldownDuration: 0
InterruptsOnStop: 1
NumberOfRepeats: 0
RepeatForever: 0
DelayBetweenRepeats: 1
MMFeedbacksDirectionCondition: 0
PlayDirection: 0
ConstantIntensity: 0
UseIntensityInterval: 0
IntensityIntervalMin: 0
IntensityIntervalMax: 0
Sequence: {fileID: 0}
TrackID: 0
Quantized: 0
TargetBPM: 120
AutomatedTargetAcquisition:
Mode: 0
ChildIndex: 0
RandomizeOutput: 0
RandomMultiplier: {x: 0.8, y: 1}
RandomizeDuration: 0
RandomDurationMultiplier: {x: 0.5, y: 2}
UseRange: 0
RangeDistance: 5
UseRangeFalloff: 0
RangeFalloff:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
RemapRangeFalloff: {x: 0, y: 1}
Owner: {fileID: 6466343129216784876}
DebugActive: 0
Mode: 0
AnimateScaleTarget: {fileID: 7785295853672088418}
AnimateScaleDuration: 0.2
RemapCurveZero: 1
RemapCurveOne: 2
Offset: 0
AnimateX: 1
AnimateScaleTweenX:
MMTweenDefinitionType: 1
MMTweenCurve: 4
Curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
Initialized: 1
AnimateY: 1
AnimateScaleTweenY:
MMTweenDefinitionType: 1
MMTweenCurve: 4
Curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
Initialized: 1
AnimateZ: 1
AnimateScaleTweenZ:
MMTweenDefinitionType: 1
MMTweenCurve: 4
Curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
Initialized: 1
UniformScaling: 0
AllowAdditivePlays: 0
DetermineScaleOnPlay: 0
DestinationScale: {x: 0.5, y: 0.5, z: 0.5}
AnimateScaleX:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
AnimateScaleY:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
AnimateScaleZ:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1 &8775573913838539411
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7621044863247771369}
- component: {fileID: 7099137272689354293}
- component: {fileID: 8042657054365514525}
m_Layer: 0
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7621044863247771369
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8775573913838539411}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1390129691196447985}
m_Father: {fileID: 3258814973617716309}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!23 &7099137272689354293
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8775573913838539411}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 7159369417392969216, guid: 3944eaaf70beffa4097d8c293604125e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &8042657054365514525
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8775573913838539411}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 150
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 3944eaaf70beffa4097d8c293604125e, type: 2}
m_sharedMaterial: {fileID: 7159369417392969216, guid: 3944eaaf70beffa4097d8c293604125e,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 10
m_fontSizeBase: 10
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 0
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 1
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_renderer: {fileID: 7099137272689354293}
m_maskType: 0
_SortingLayer: 0
_SortingLayerID: 0
_SortingOrder: 0

View File

@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 0453e37c3c22e7145b8c23c7fa96de36
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/MMFloatingText/Prefabs/MMFloatingTextMeshPro.prefab
uploadId: 830868

View File

@@ -0,0 +1,3 @@
{
"reference": "GUID:4a1cb1490dc4df8409b2580d6b44e75e"
}

View File

@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: b04ed8e9bde180e45bebd340d0981646
AssemblyDefinitionReferenceImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/TextMeshPro/MoreMountains.Feedbacks.TextMeshPro.asmref
uploadId: 830868