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,362 @@
#if MM_UI
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
namespace MoreMountains.Tools
{
[RequireComponent(typeof(Text))]
[AddComponentMenu("More Mountains/Tools/Time/MM Countdown")]
public class MMCountdown : MMMonoBehaviour
{
[Serializable]
/// <summary>
/// A class to store floor information
/// </summary>
public class MMCountdownFloor
{
/// the value (in seconds) for this floor. Every FloorValue, the corresponding event will be triggered
public float FloorValue;
[MMReadOnly]
/// the time (in seconds) this floor was last triggered at
public float LastChangedAt = 0f;
/// the event to trigger when this floor is reached
public UnityEvent FloorEvent;
}
/// the possible directions for this countdown
public enum MMCountdownDirections { Ascending, Descending }
[MMInspectorGroup("Countdown", true, 18)]
[MMInformation("You can define the bounds of the countdown (how much it should count down from, and to how much, the format it should be displayed in (standard Unity float ToString formatting).", MoreMountains.Tools.MMInformationAttribute.InformationType.Info, false)]
/// the time (in seconds) to count down from
public float CountdownFrom = 60f;
/// the time (in seconds) to count down to
public float CountdownTo = 0f;
/// if this is true, the countdown will have no end and will just keep counting in its direction
public bool Infinite = false;
public enum FormatMethods { Explicit, Choices }
[MMInspectorGroup("Display", true, 19)]
/// the selected format method
public FormatMethods FormatMethod = FormatMethods.Choices;
/// whether or not values should be floored before displaying them
[MMEnumCondition("FormatMethod", (int)FormatMethods.Explicit)]
public bool FloorValues = true;
/// the format (standard Unity ToString) to use when displaying the time left in the text field
[MMEnumCondition("FormatMethod", (int)FormatMethods.Explicit)]
public string Format = "00.00";
[MMEnumCondition("FormatMethod", (int)FormatMethods.Choices)]
public bool Hours = false;
[MMEnumCondition("FormatMethod", (int)FormatMethods.Choices)]
public bool Minutes = true;
[MMEnumCondition("FormatMethod", (int)FormatMethods.Choices)]
public bool Seconds = true;
[MMEnumCondition("FormatMethod", (int)FormatMethods.Choices)]
public bool Milliseconds = false;
[MMInspectorGroup("Settings", true, 20)]
[MMInformation("You can choose whether or not the countdown should automatically start on its Start, at what frequency (in seconds) it should refresh (0 means every frame), and the countdown's speed multiplier " +
"(2 will be twice as fast, 0.5 half normal speed, etc). Floors are used to define and trigger events when certain floors are reached. For each floor, define a floor value (in seconds). Everytime this floor gets reached, the corresponding event will be triggered." +
"Bind events here to trigger them when the countdown reaches its To destination, or every time it gets refreshed.", MoreMountains.Tools.MMInformationAttribute.InformationType.Info, false)]
/// if this is true, the countdown will start as soon as this object Starts
public bool AutoStart = true;
/// if this is true, the countdown will automatically go back to its initial value when it reaches its destination
public bool AutoReset = false;
/// if this is true, the countdown will pingpong in the other direction when end is met
public bool PingPong = false;
/// the frequency (in seconds) at which to refresh the text field
public float RefreshFrequency = 0.02f;
/// the speed of the countdown (2 : twice the normal speed, 0.5 : twice slower)
public float CountdownSpeed = 1f;
[MMInspectorGroup("Floors", true, 21)]
/// a list of floors this countdown will evaluate and trigger if met
public List<MMCountdownFloor> Floors;
[MMInspectorGroup("Events", true, 22)]
/// an event to trigger when the countdown reaches its destination
public UnityEvent CountdownCompleteEvent;
/// an event to trigger every time the countdown text gets refreshed
public UnityEvent CountdownRefreshEvent;
[MMInspectorGroup("Debug", true, 17)]
[MMReadOnly]
/// the time left in our countdown
public float CurrentTime;
[MMReadOnly]
/// the direction of the countdown (going 1, 2, 3 if Ascending, and 3, 2, 1 if Descending)
public MMCountdownDirections Direction;
/// Debug button to stop the countdown
[MMInspectorButton("StopCountdown")]
public bool StopCountdownButton;
/// Debug button to start the countdown
[MMInspectorButton("StartCountdown")]
public bool StartCountdownButton;
/// Debug button to reset the countdown
[MMInspectorButton("ResetCountdown")]
public bool ResetCountdownButton;
/// Debug button to change the direction of the countdown
[MMInspectorButton("ChangeDirection")]
public bool ChangeDirectionButton;
/// A debug value to which to set the current time when pressing the DebugSetNewCurrentTime button
public float DebugNewCurrentTime = 5f;
/// Debug button to change the countdown's current time
[MMInspectorButton("DebugSetNewCurrentTime")]
public bool DebugSetNewCurrentTimeButton;
/// <summary>
/// Debug method to change the current time to the specified debug value
/// </summary>
private void DebugSetNewCurrentTime()
{
SetCurrentTime(DebugNewCurrentTime);
}
protected Text _text;
protected float _lastRefreshAt;
protected bool _countdowning = false;
protected int _lastUnitValue = 0;
#region INITIALIZATION
/// <summary>
/// On Start, grabs and stores the Text component, and autostarts if needed
/// </summary>
protected virtual void Start()
{
_text = this.gameObject.GetComponent<Text>();
Initialization();
}
/// <summary>
/// On init, initializes the direction, handles auto start and floors
/// </summary>
protected virtual void Initialization()
{
_lastUnitValue = (int)CurrentTime;
Direction = (CountdownFrom > CountdownTo) ? MMCountdownDirections.Descending : MMCountdownDirections.Ascending;
CurrentTime = CountdownFrom;
if (AutoStart)
{
StartCountdown();
}
foreach (MMCountdownFloor floor in Floors)
{
floor.LastChangedAt = CountdownFrom;
}
}
#endregion
#region UPDATE
/// <summary>
/// On Update, updates the Time, text, checks for floors and checks for the end of the countdown
/// </summary>
protected virtual void Update()
{
// if we're not countdowning, we do nothing and exit
if (!_countdowning)
{
return;
}
// we update our current time
UpdateTime();
UpdateText();
CheckForFloors();
CheckForEnd();
}
/// <summary>
/// Updates the CurrentTime value by substracting the delta time, factored by the defined speed
/// </summary>
protected virtual void UpdateTime()
{
if (Direction == MMCountdownDirections.Descending)
{
CurrentTime -= Time.deltaTime * CountdownSpeed;
}
else
{
CurrentTime += Time.deltaTime * CountdownSpeed;
}
}
/// <summary>
/// Refreshes the text component at the specified refresh frequency
/// </summary>
protected virtual void UpdateText()
{
if (Time.time - _lastRefreshAt > RefreshFrequency)
{
if (_text != null)
{
string newText = "";
if (FormatMethod == FormatMethods.Explicit)
{
if (FloorValues)
{
newText = Mathf.Floor(CurrentTime).ToString(Format);
}
else
{
newText = CurrentTime.ToString(Format);
}
}
else
{
newText = MMTime.FloatToTimeString(CurrentTime, Hours, Minutes, Seconds, Milliseconds);
}
_text.text = newText;
}
if (CountdownRefreshEvent != null)
{
CountdownRefreshEvent.Invoke();
}
_lastRefreshAt = Time.time;
}
}
/// <summary>
/// Checks whether or not we've reached the end of the countdown
/// </summary>
protected virtual void CheckForEnd()
{
if (Infinite)
{
return;
}
bool endReached = (Direction == MMCountdownDirections.Ascending) ? (CurrentTime >= CountdownTo) : (CurrentTime <= CountdownTo);
if (endReached)
{
if (CountdownCompleteEvent != null)
{
CountdownCompleteEvent.Invoke();
}
if (PingPong)
{
Direction = (Direction == MMCountdownDirections.Ascending) ? MMCountdownDirections.Descending : MMCountdownDirections.Ascending;
_countdowning = true;
float temp = CountdownFrom;
CountdownFrom = CountdownTo;
CountdownTo = temp;
}
else if (AutoReset)
{
_countdowning = true;
CurrentTime = CountdownFrom;
}
else
{
CurrentTime = CountdownTo;
_countdowning = false;
}
}
}
/// <summary>
/// Every frame, checks if we've reached one of the defined floors, and triggers the corresponding events if that's the case
/// </summary>
protected virtual void CheckForFloors()
{
foreach(MMCountdownFloor floor in Floors)
{
if (Mathf.Abs(CurrentTime - floor.LastChangedAt) >= floor.FloorValue)
{
if (floor.FloorEvent != null)
{
floor.FloorEvent.Invoke();
}
if (Direction == MMCountdownDirections.Descending)
{
if (floor.LastChangedAt == CountdownFrom)
{
floor.LastChangedAt = CountdownFrom - floor.FloorValue;
}
else
{
floor.LastChangedAt = floor.LastChangedAt - floor.FloorValue;
}
}
else
{
if (floor.LastChangedAt == CountdownFrom)
{
floor.LastChangedAt = CountdownFrom + floor.FloorValue;
}
else
{
floor.LastChangedAt = floor.LastChangedAt + floor.FloorValue;
}
}
}
}
}
#endregion
#region CONTROLS
/// <summary>
/// Starts (or restarts) the countdown
/// </summary>
public virtual void StartCountdown()
{
_countdowning = true;
}
/// <summary>
/// Stops the countdown from countdowning
/// </summary>
public virtual void StopCountdown()
{
_countdowning = false;
}
/// <summary>
/// Resets the countdown, setting its current time to the one defined in the inspector
/// </summary>
public virtual void ResetCountdown()
{
CurrentTime = CountdownFrom;
Initialization();
}
/// <summary>
/// Changes the direction of the countdown from ascending to descending, or from descending to ascending
/// </summary>
public virtual void ChangeDirection()
{
Direction = Direction == MMCountdownDirections.Descending
? MMCountdownDirections.Ascending
: MMCountdownDirections.Descending;
(CountdownFrom, CountdownTo) = (CountdownTo, CountdownFrom);
}
/// <summary>
/// Sets the current time to the new specified value
/// </summary>
/// <param name="newCurrentTime"></param>
public virtual void SetCurrentTime(float newCurrentTime)
{
CurrentTime = newCurrentTime;
}
#endregion
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 9865be098e06f714091b51ba01ecec85
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/MMTools/Accessories/MMGUI/MMCountdown.cs
uploadId: 830868

View File

@@ -0,0 +1,31 @@
using UnityEngine;
namespace MoreMountains.Tools
{
/// <summary>
/// Add this class to an object and it'll make sure that the cursor is either visible or invisible
/// </summary>
[AddComponentMenu("More Mountains/Tools/GUI/MM Cursor Visible")]
public class MMCursorVisible : MonoBehaviour
{
/// The possible states of the cursor
public enum CursorVisibilities { Visible, Invisible }
/// Whether that cursor should be visible or invisible
public CursorVisibilities CursorVisibility = CursorVisibilities.Visible;
/// <summary>
/// On Update we change the status of our cursor accordingly
/// </summary>
protected virtual void Update()
{
if (CursorVisibility == CursorVisibilities.Visible)
{
Cursor.visible = true;
}
else
{
Cursor.visible = false;
}
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 98e84bec6c36ca5419922f3def4d4267
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/MMTools/Accessories/MMGUI/MMCursorVisible.cs
uploadId: 830868

View File

@@ -0,0 +1,22 @@
#if MM_UI
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using MoreMountains.Tools;
using UnityEngine.EventSystems;
namespace MoreMountains.Tools
{
/// <summary>
/// Add this helper to an object and focus will be set to it on Enable
/// </summary>
[AddComponentMenu("More Mountains/Tools/GUI/MM Get Focus On Enable")]
public class MMGetFocusOnEnable : MonoBehaviour
{
protected virtual void OnEnable()
{
EventSystem.current.SetSelectedGameObject(this.gameObject, null);
}
}
}
#endif

View File

@@ -0,0 +1,20 @@
fileFormatVersion: 2
guid: 4c7437225490c3443b6d19ca7cc00196
timeCreated: 1523894192
licenseType: Store
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/MMTools/Accessories/MMGUI/MMGetFocusOnEnable.cs
uploadId: 830868

View File

@@ -0,0 +1,523 @@
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
#if MM_UI
using UnityEngine.UI;
#endif
namespace MoreMountains.Tools
{
/// <summary>
/// Add this component to an object and it will show a healthbar above it
/// You can either use a prefab for it, or have the component draw one at the start
/// </summary>
[AddComponentMenu("More Mountains/Tools/GUI/MM Health Bar")]
public class MMHealthBar : MonoBehaviour
{
#if MM_UI
/// the possible health bar types
public enum HealthBarTypes { Prefab, Drawn, Existing }
/// the possible timescales the bar can work on
public enum TimeScales { UnscaledTime, Time }
[MMInformation("Add this component to an object and it'll add a healthbar next to it to reflect its health level in real time. You can decide here whether the health bar should be drawn automatically or use a prefab.",MoreMountains.Tools.MMInformationAttribute.InformationType.Info,false)]
/// whether the healthbar uses a prefab or is drawn automatically
[Tooltip("whether the healthbar uses a prefab or is drawn automatically")]
public HealthBarTypes HealthBarType = HealthBarTypes.Drawn;
/// defines whether the bar will work on scaled or unscaled time (whether or not it'll keep moving if time is slowed down for example)
[Tooltip("defines whether the bar will work on scaled or unscaled time (whether or not it'll keep moving if time is slowed down for example)")]
public TimeScales TimeScale = TimeScales.UnscaledTime;
[Header("Select a Prefab")]
[MMInformation("Select a prefab with a progress bar script on it. There is one example of such a prefab in Common/Prefabs/GUI.",MoreMountains.Tools.MMInformationAttribute.InformationType.Info,false)]
/// the prefab to use as the health bar
[Tooltip("the prefab to use as the health bar")]
public MMProgressBar HealthBarPrefab;
[Header("Existing MMProgressBar")]
/// the MMProgressBar this health bar should update
[Tooltip("the MMProgressBar this health bar should update")]
public MMProgressBar TargetProgressBar;
[Header("Drawn Healthbar Settings ")]
[MMInformation("Set the size (in world units), padding, back and front colors of the healthbar.",MoreMountains.Tools.MMInformationAttribute.InformationType.Info,false)]
/// if the healthbar is drawn, its size in world units
[Tooltip("if the healthbar is drawn, its size in world units")]
public Vector2 Size = new Vector2(1f,0.2f);
/// if the healthbar is drawn, the padding to apply to the foreground, in world units
[Tooltip("if the healthbar is drawn, the padding to apply to the foreground, in world units")]
public Vector2 BackgroundPadding = new Vector2(0.01f,0.01f);
/// the rotation to apply to the MMHealthBarContainer when drawing it
[Tooltip("the rotation to apply to the MMHealthBarContainer when drawing it")]
public Vector3 InitialRotationAngles;
/// if the healthbar is drawn, the color of its foreground
[Tooltip("if the healthbar is drawn, the color of its foreground")]
public Gradient ForegroundColor = new Gradient()
{
colorKeys = new GradientColorKey[2] {
new GradientColorKey(MMColors.BestRed, 0),
new GradientColorKey(MMColors.BestRed, 1f)
},
alphaKeys = new GradientAlphaKey[2] {new GradientAlphaKey(1, 0),new GradientAlphaKey(1, 1)}};
/// if the healthbar is drawn, the color of its delayed bar
[Tooltip("if the healthbar is drawn, the color of its delayed bar")]
public Gradient DelayedColor = new Gradient()
{
colorKeys = new GradientColorKey[2] {
new GradientColorKey(MMColors.Orange, 0),
new GradientColorKey(MMColors.Orange, 1f)
},
alphaKeys = new GradientAlphaKey[2] { new GradientAlphaKey(1, 0), new GradientAlphaKey(1, 1) }
};
/// if the healthbar is drawn, the color of its border
[Tooltip("if the healthbar is drawn, the color of its border")]
public Gradient BorderColor = new Gradient()
{
colorKeys = new GradientColorKey[2] {
new GradientColorKey(MMColors.AntiqueWhite, 0),
new GradientColorKey(MMColors.AntiqueWhite, 1f)
},
alphaKeys = new GradientAlphaKey[2] { new GradientAlphaKey(1, 0), new GradientAlphaKey(1, 1) }
};
/// if the healthbar is drawn, the color of its background
[Tooltip("if the healthbar is drawn, the color of its background")]
public Gradient BackgroundColor = new Gradient()
{
colorKeys = new GradientColorKey[2] {
new GradientColorKey(MMColors.Black, 0),
new GradientColorKey(MMColors.Black, 1f)
},
alphaKeys = new GradientAlphaKey[2] { new GradientAlphaKey(1, 0), new GradientAlphaKey(1, 1) }
};
/// the name of the sorting layer to put this health bar on
[Tooltip("the name of the sorting layer to put this health bar on")]
public string SortingLayerName = "UI";
/// the delay to apply to the delayed bar if drawn
[Tooltip("the delay to apply to the delayed bar if drawn")]
public float Delay = 0.5f;
/// whether or not the front bar should lerp
[Tooltip("whether or not the front bar should lerp")]
public bool LerpFrontBar = true;
/// the speed at which the front bar lerps
[Tooltip("the speed at which the front bar lerps")]
public float LerpFrontBarSpeed = 15f;
/// whether or not the delayed bar should lerp
[Tooltip("whether or not the delayed bar should lerp")]
public bool LerpDelayedBar = true;
/// the speed at which the delayed bar lerps
[Tooltip("the speed at which the delayed bar lerps")]
public float LerpDelayedBarSpeed = 15f;
/// if this is true, bumps the scale of the healthbar when its value changes
[Tooltip("if this is true, bumps the scale of the healthbar when its value changes")]
public bool BumpScaleOnChange = true;
/// the duration of the bump animation
[Tooltip("the duration of the bump animation")]
public float BumpDuration = 0.2f;
/// the animation curve to map the bump animation on
[Tooltip("the animation curve to map the bump animation on")]
public AnimationCurve BumpAnimationCurve = AnimationCurve.Constant(0,1,1);
/// the mode the bar should follow the target in
[Tooltip("the mode the bar should follow the target in")]
public MMFollowTarget.UpdateModes FollowTargetMode = MMFollowTarget.UpdateModes.LateUpdate;
/// if this is true, the drawn health bar will adapt its rotation to match the one of its target
[Tooltip("if this is true, the drawn health bar will adapt its rotation to match the one of its target")]
public bool FollowRotation = false;
/// if this is true, the drawn health bar will adapt its scale to match the one of its target
[Tooltip("if this is true, the drawn health bar will adapt its scale to match the one of its target")]
public bool FollowScale = true;
/// if this is true, the drawn health bar will be nested below the MMHealthBar
[Tooltip("if this is true, the drawn health bar will be nested below the MMHealthBar")]
public bool NestDrawnHealthBar = false;
/// if this is true, a MMBillboard component will be added to the progress bar to make sure it always looks towards the camera
[Tooltip("if this is true, a MMBillboard component will be added to the progress bar to make sure it always looks towards the camera")]
public bool Billboard = false;
[Header("Death")]
/// a gameobject (usually a particle system) to instantiate when the healthbar reaches zero
[Tooltip("a gameobject (usually a particle system) to instantiate when the healthbar reaches zero")]
public GameObject InstantiatedOnDeath;
[Header("Offset")]
[MMInformation("Set the offset (in world units), relative to the object's center, to which the health bar will be displayed.",MoreMountains.Tools.MMInformationAttribute.InformationType.Info,false)]
/// the offset to apply to the healthbar compared to the object's center
[Tooltip("the offset to apply to the healthbar compared to the object's center")]
public Vector3 HealthBarOffset = new Vector3(0f,1f,0f);
[Header("Display")]
[MMInformation("Here you can define whether or not the healthbar should always be visible. If not, you can set here how long after a hit it'll remain visible.",MoreMountains.Tools.MMInformationAttribute.InformationType.Info,false)]
/// whether or not the bar should be permanently displayed
[Tooltip("whether or not the bar should be permanently displayed")]
public bool AlwaysVisible = true;
/// the duration (in seconds) during which to display the bar
[Tooltip("the duration (in seconds) during which to display the bar")]
public float DisplayDurationOnHit = 1f;
/// if this is set to true the bar will hide itself when it reaches zero
[Tooltip("if this is set to true the bar will hide itself when it reaches zero")]
public bool HideBarAtZero = true;
/// the delay (in seconds) after which to hide the bar
[Tooltip("the delay (in seconds) after which to hide the bar")]
public float HideBarAtZeroDelay = 1f;
[Header("Test")]
/// a test value to use when pressing the TestUpdateHealth button
[Tooltip("a test value to use when pressing the TestUpdateHealth button")]
public float TestMinHealth = 0f;
/// a test value to use when pressing the TestUpdateHealth button
[Tooltip("a test value to use when pressing the TestUpdateHealth button")]
public float TestMaxHealth = 100f;
/// a test value to use when pressing the TestUpdateHealth button
[Tooltip("a test value to use when pressing the TestUpdateHealth button")]
public float TestCurrentHealth = 25f;
[MMInspectorButton("TestUpdateHealth")]
public bool TestUpdateHealthButton;
protected MMProgressBar _progressBar;
protected MMFollowTarget _followTransform;
protected float _lastShowTimestamp = 0f;
protected bool _showBar = false;
protected Image _backgroundImage = null;
protected Image _borderImage = null;
protected Image _foregroundImage = null;
protected Image _delayedImage = null;
protected bool _finalHideStarted = false;
/// <summary>
/// On Start, creates or sets the health bar up
/// </summary>
protected virtual void Awake()
{
Initialization();
}
/// <summary>
/// On enable, initializes the bar again
/// </summary>
protected void OnEnable()
{
_finalHideStarted = false;
SetInitialActiveState();
}
/// <summary>
/// Forces the bar into its initial active state (hiding it if AlwaysVisible is false)
/// </summary>
public virtual void SetInitialActiveState()
{
if (!AlwaysVisible && (_progressBar != null))
{
ShowBar(false);
}
}
/// <summary>
/// Shows or hides the bar by changing its object's active state
/// </summary>
/// <param name="state"></param>
public virtual void ShowBar(bool state)
{
_progressBar.gameObject.SetActive(state);
}
/// <summary>
/// Whether or not the bar is currently active
/// </summary>
/// <returns></returns>
public virtual bool BarIsShown()
{
return _progressBar.gameObject.activeInHierarchy;
}
/// <summary>
/// Initializes the bar (handles visibility, parenting, initial value
/// </summary>
public virtual void Initialization()
{
_finalHideStarted = false;
if (_progressBar != null)
{
ShowBar(AlwaysVisible);
return;
}
switch (HealthBarType)
{
case HealthBarTypes.Prefab:
if (HealthBarPrefab == null)
{
Debug.LogWarning(this.name + " : the HealthBar has no prefab associated to it, nothing will be displayed.");
return;
}
_progressBar = Instantiate(HealthBarPrefab, transform.position + HealthBarOffset, transform.rotation) as MMProgressBar;
SceneManager.MoveGameObjectToScene(_progressBar.gameObject, this.gameObject.scene);
_progressBar.transform.SetParent(this.transform);
_progressBar.gameObject.name = "HealthBar";
break;
case HealthBarTypes.Drawn:
DrawHealthBar();
UpdateDrawnColors();
break;
case HealthBarTypes.Existing:
_progressBar = TargetProgressBar;
break;
}
if (!AlwaysVisible)
{
ShowBar(false);
}
if (_progressBar != null)
{
_progressBar.SetBar(100f, 0f, 100f);
}
}
/// <summary>
/// Draws the health bar.
/// </summary>
protected virtual void DrawHealthBar()
{
GameObject newGameObject = new GameObject();
SceneManager.MoveGameObjectToScene(newGameObject, this.gameObject.scene);
newGameObject.name = "HealthBar|"+this.gameObject.name;
if (NestDrawnHealthBar)
{
newGameObject.transform.SetParent(this.transform);
}
_progressBar = newGameObject.AddComponent<MMProgressBar>();
_followTransform = newGameObject.AddComponent<MMFollowTarget>();
_followTransform.Offset = HealthBarOffset;
_followTransform.Target = this.transform;
_followTransform.FollowRotation = FollowRotation;
_followTransform.FollowScale = FollowScale;
_followTransform.InterpolatePosition = false;
_followTransform.InterpolateRotation = false;
_followTransform.UpdateMode = FollowTargetMode;
Canvas newCanvas = newGameObject.AddComponent<Canvas>();
newCanvas.renderMode = RenderMode.WorldSpace;
newCanvas.transform.localScale = Vector3.one;
newCanvas.GetComponent<RectTransform>().sizeDelta = Size;
if (!string.IsNullOrEmpty(SortingLayerName))
{
newCanvas.sortingLayerName = SortingLayerName;
}
GameObject container = new GameObject();
container.transform.SetParent(newGameObject.transform);
container.name = "MMProgressBarContainer";
container.transform.localScale = Vector3.one;
GameObject borderImageGameObject = new GameObject();
borderImageGameObject.transform.SetParent(container.transform);
borderImageGameObject.name = "HealthBar Border";
_borderImage = borderImageGameObject.AddComponent<Image>();
_borderImage.transform.position = Vector3.zero;
_borderImage.transform.localScale = Vector3.one;
_borderImage.GetComponent<RectTransform>().sizeDelta = Size;
_borderImage.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
GameObject bgImageGameObject = new GameObject();
bgImageGameObject.transform.SetParent(container.transform);
bgImageGameObject.name = "HealthBar Background";
_backgroundImage = bgImageGameObject.AddComponent<Image>();
_backgroundImage.transform.position = Vector3.zero;
_backgroundImage.transform.localScale = Vector3.one;
_backgroundImage.GetComponent<RectTransform>().sizeDelta = Size - BackgroundPadding*2;
_backgroundImage.GetComponent<RectTransform>().anchoredPosition = -_backgroundImage.GetComponent<RectTransform>().sizeDelta/2;
_backgroundImage.GetComponent<RectTransform>().pivot = Vector2.zero;
GameObject delayedImageGameObject = new GameObject();
delayedImageGameObject.transform.SetParent(container.transform);
delayedImageGameObject.name = "HealthBar Delayed Foreground";
_delayedImage = delayedImageGameObject.AddComponent<Image>();
_delayedImage.transform.position = Vector3.zero;
_delayedImage.transform.localScale = Vector3.one;
_delayedImage.GetComponent<RectTransform>().sizeDelta = Size - BackgroundPadding*2;
_delayedImage.GetComponent<RectTransform>().anchoredPosition = -_delayedImage.GetComponent<RectTransform>().sizeDelta/2;
_delayedImage.GetComponent<RectTransform>().pivot = Vector2.zero;
GameObject frontImageGameObject = new GameObject();
frontImageGameObject.transform.SetParent(container.transform);
frontImageGameObject.name = "HealthBar Foreground";
_foregroundImage = frontImageGameObject.AddComponent<Image>();
_foregroundImage.transform.position = Vector3.zero;
_foregroundImage.transform.localScale = Vector3.one;
_foregroundImage.color = ForegroundColor.Evaluate(1);
_foregroundImage.GetComponent<RectTransform>().sizeDelta = Size - BackgroundPadding*2;
_foregroundImage.GetComponent<RectTransform>().anchoredPosition = -_foregroundImage.GetComponent<RectTransform>().sizeDelta/2;
_foregroundImage.GetComponent<RectTransform>().pivot = Vector2.zero;
if (Billboard)
{
MMBillboard billboard = _progressBar.gameObject.AddComponent<MMBillboard>();
billboard.NestObject = !NestDrawnHealthBar;
}
_progressBar.LerpDecreasingDelayedBar = LerpDelayedBar;
_progressBar.LerpForegroundBar = LerpFrontBar;
_progressBar.LerpDecreasingDelayedBarSpeed = LerpDelayedBarSpeed;
_progressBar.LerpForegroundBarSpeedIncreasing = LerpFrontBarSpeed;
_progressBar.ForegroundBar = _foregroundImage.transform;
_progressBar.DelayedBarDecreasing = _delayedImage.transform;
_progressBar.DecreasingDelay = Delay;
_progressBar.BumpScaleOnChange = BumpScaleOnChange;
_progressBar.BumpDuration = BumpDuration;
_progressBar.BumpScaleAnimationCurve = BumpAnimationCurve;
_progressBar.TimeScale = (TimeScale == TimeScales.Time) ? MMProgressBar.TimeScales.Time : MMProgressBar.TimeScales.UnscaledTime;
container.transform.localEulerAngles = InitialRotationAngles;
_progressBar.Initialization();
}
/// <summary>
/// On Update, we hide or show our healthbar based on our current status
/// </summary>
protected virtual void Update()
{
if (_progressBar == null)
{
return;
}
if (_finalHideStarted)
{
return;
}
UpdateDrawnColors();
if (AlwaysVisible)
{
return;
}
if (_showBar)
{
ShowBar(true);
float currentTime = (TimeScale == TimeScales.UnscaledTime) ? Time.unscaledTime : Time.time;
if (currentTime - _lastShowTimestamp > DisplayDurationOnHit)
{
_showBar = false;
}
}
else
{
if (BarIsShown())
{
ShowBar(false);
}
}
}
/// <summary>
/// Hides the bar when it reaches zero
/// </summary>
/// <returns>The hide bar.</returns>
protected virtual IEnumerator FinalHideBar()
{
_finalHideStarted = true;
if (InstantiatedOnDeath != null)
{
GameObject instantiatedOnDeath = Instantiate(InstantiatedOnDeath, this.transform.position + HealthBarOffset, this.transform.rotation);
SceneManager.MoveGameObjectToScene(instantiatedOnDeath.gameObject, this.gameObject.scene);
}
if (HideBarAtZeroDelay == 0)
{
_showBar = false;
ShowBar(false);
yield return null;
}
else
{
_progressBar.HideBar(HideBarAtZeroDelay);
}
}
/// <summary>
/// Updates the colors of the different bars
/// </summary>
protected virtual void UpdateDrawnColors()
{
if (HealthBarType != HealthBarTypes.Drawn)
{
return;
}
if (_progressBar.Bumping)
{
return;
}
if (_borderImage != null)
{
_borderImage.color = BorderColor.Evaluate(_progressBar.BarProgress);
}
if (_backgroundImage != null)
{
_backgroundImage.color = BackgroundColor.Evaluate(_progressBar.BarProgress);
}
if (_delayedImage != null)
{
_delayedImage.color = DelayedColor.Evaluate(_progressBar.BarProgress);
}
if (_foregroundImage != null)
{
_foregroundImage.color = ForegroundColor.Evaluate(_progressBar.BarProgress);
}
}
/// <summary>
/// Updates the bar
/// </summary>
/// <param name="currentHealth">Current health.</param>
/// <param name="minHealth">Minimum health.</param>
/// <param name="maxHealth">Max health.</param>
/// <param name="show">Whether or not we should show the bar.</param>
public virtual void UpdateBar(float currentHealth, float minHealth, float maxHealth, bool show)
{
// if the healthbar isn't supposed to be always displayed, we turn it on for the specified duration
if (!AlwaysVisible && show)
{
_showBar = true;
_lastShowTimestamp = (TimeScale == TimeScales.UnscaledTime) ? Time.unscaledTime : Time.time;
}
if (_progressBar != null)
{
_progressBar.UpdateBar(currentHealth, minHealth, maxHealth) ;
if (HideBarAtZero && _progressBar.BarTarget <= 0)
{
StartCoroutine(FinalHideBar());
}
if (BumpScaleOnChange)
{
_progressBar.Bump();
}
}
}
/// <summary>
/// A test method used to update the bar when pressing the TestUpdateHealth button in the inspector
/// </summary>
protected virtual void TestUpdateHealth()
{
UpdateBar(TestCurrentHealth, TestMinHealth, TestMaxHealth, true);
}
#endif
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 8abe6344b7148db4687d3c84e7712904
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/MMTools/Accessories/MMGUI/MMHealthBar.cs
uploadId: 830868

View File

@@ -0,0 +1,79 @@
#if MM_UI
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
namespace MoreMountains.Tools
{
/// <summary>
/// A simple helper class you can use to trigger methods on Unity's pointer events
/// Typically used on a UI Image
/// </summary>
public class MMOnPointer : MonoBehaviour, IPointerDownHandler, IPointerEnterHandler, IPointerUpHandler, IPointerExitHandler, IPointerClickHandler
{
[Header("Pointer movement")]
/// an event to trigger when the pointer enters the associated game object
[Tooltip("an event to trigger when the pointer enters the associated game object")]
public UnityEvent PointerEnter;
/// an event to trigger when the pointer exits the associated game object
[Tooltip("an event to trigger when the pointer exits the associated game object")]
public UnityEvent PointerExit;
[Header("Clicks")]
/// an event to trigger when the pointer is pressed down on the associated game object
[Tooltip("an event to trigger when the pointer is pressed down on the associated game object")]
public UnityEvent PointerDown;
/// an event to trigger when the pointer is pressed up on the associated game object
[Tooltip("an event to trigger when the pointer is pressed up on the associated game object")]
public UnityEvent PointerUp;
/// an event to trigger when the pointer is clicked on the associated game object
[Tooltip("an event to trigger when the pointer is clicked on the associated game object")]
public UnityEvent PointerClick;
/// <summary>
/// IPointerEnterHandler implementation
/// </summary>
/// <param name="eventData"></param>
public void OnPointerEnter(PointerEventData eventData)
{
PointerEnter?.Invoke();
}
/// <summary>
/// IPointerExitHandler implementation
/// </summary>
/// <param name="eventData"></param>
public void OnPointerExit(PointerEventData eventData)
{
PointerExit?.Invoke();
}
/// <summary>
/// IPointerDownHandler implementation
/// </summary>
/// <param name="eventData"></param>
public void OnPointerDown(PointerEventData eventData)
{
PointerDown?.Invoke();
}
/// <summary>
/// IPointerUpHandler implementation
/// </summary>
/// <param name="eventData"></param>
public void OnPointerUp(PointerEventData eventData)
{
PointerUp?.Invoke();
}
/// <summary>
/// IPointerClickHandler implementation
/// </summary>
/// <param name="eventData"></param>
public void OnPointerClick(PointerEventData eventData)
{
PointerClick?.Invoke();
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 4b69e4219f8a33d46b034129f4d3ddea
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/MMTools/Accessories/MMGUI/MMOnPointer.cs
uploadId: 830868

View File

@@ -0,0 +1,129 @@
#if MM_UI
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
namespace MoreMountains.Tools
{
[AddComponentMenu("More Mountains/Tools/GUI/MM PSB To UI Converter")]
public class MMPSBToUIConverter : MonoBehaviour
{
[Header("Target")]
public Canvas TargetCanvas;
public float ScaleFactor = 100f;
public bool ReplicateNesting = false;
[Header("Size")]
public float TargetWidth = 2048;
public float TargetHeight = 1152;
[Header("Conversion")]
[MMInspectorButton("ConvertToCanvas")]
public bool ConvertToCanvasButton;
public Vector3 ChildImageOffset = new Vector3(-1024f, -576f, 0f);
protected Transform _topLevel;
protected Dictionary<Transform, int> _sortingOrders;
public virtual void ConvertToCanvas()
{
Screen.SetResolution((int)TargetWidth, (int)TargetHeight, true);
_sortingOrders = new Dictionary<Transform, int>();
// remove existing canvas if found
foreach (Transform child in TargetCanvas.transform)
{
if (child.name == this.name)
{
child.MMDestroyAllChildren();
DestroyImmediate(child.gameObject);
}
}
// force size on canvas scaler
CanvasScaler canvasScaler = TargetCanvas.GetComponent<CanvasScaler>();
if (canvasScaler != null)
{
canvasScaler.referenceResolution = new Vector2(TargetWidth, TargetHeight);
}
// create a parent in the target canvas
GameObject newRoot = new GameObject(this.name, typeof(RectTransform));
newRoot.transform.SetParent(TargetCanvas.transform);
RectTransform newRootRect = newRoot.GetComponent<RectTransform>();
SetupForStretch(newRootRect);
_topLevel = newRoot.transform;
CreateImageForChildren(this.transform, newRoot.transform);
// apply sorting orders
foreach (KeyValuePair<Transform, int> pair in _sortingOrders)
{
pair.Key.SetSiblingIndex(pair.Value);
}
}
/// <summary>
/// Recursively goes through the children of the specified "root" Transform, and parents them to the specified "parent"
/// </summary>
/// <param name="root"></param>
/// <param name="parent"></param>
protected virtual void CreateImageForChildren(Transform root, Transform parent)
{
foreach (Transform child in root)
{
GameObject imageGO = new GameObject(child.name, typeof(RectTransform));
imageGO.transform.localPosition = ScaleFactor * child.transform.localPosition;
if (ReplicateNesting)
{
imageGO.transform.SetParent(parent);
}
else
{
imageGO.transform.SetParent(_topLevel);
Vector3 newLocalPosition = imageGO.transform.localPosition;
newLocalPosition.x = newLocalPosition.x + TargetWidth / 2f;
imageGO.transform.localPosition = newLocalPosition;
}
SpriteRenderer spriteRenderer = child.gameObject.GetComponent<SpriteRenderer>();
if (spriteRenderer != null)
{
Image image = imageGO.AddComponent<Image>();
image.sprite = spriteRenderer.sprite;
_sortingOrders.Add(image.transform, spriteRenderer.sortingOrder);
image.SetNativeSize();
RectTransform imageGoRect = imageGO.GetComponent<RectTransform>();
Vector3 newPosition = imageGoRect.localPosition;
newPosition += ChildImageOffset;
newPosition.z = 0f;
imageGoRect.localPosition = newPosition;
}
else
{
imageGO.name += " - NODE";
RectTransform imageGoRect = imageGO.GetComponent<RectTransform>();
imageGoRect.sizeDelta = new Vector2(TargetWidth, TargetHeight);
imageGoRect.localPosition = Vector3.zero;
}
imageGO.GetComponent<RectTransform>().localScale = Vector3.one;
CreateImageForChildren(child, imageGO.transform);
}
}
protected virtual void SetupForStretch(RectTransform rect)
{
rect.localPosition = Vector3.zero;
rect.anchorMin = new Vector2(0, 0);
rect.anchorMax = new Vector2(1, 1);
rect.pivot = new Vector2(0.5f, 0.5f);
rect.offsetMin = Vector2.zero;
rect.offsetMax = Vector2.zero;
rect.localScale = Vector3.one;
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 886cecdd9d0da7e429a987be6cccf1da
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/MMTools/Accessories/MMGUI/MMPSBToUIConverter.cs
uploadId: 830868

View File

@@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using UnityEngine;
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
using UnityEngine.InputSystem;
#endif
namespace MoreMountains.Tools
{
/// <summary>
/// Use this class to bind a number of UI layers to the movements of a mouse cursor, or a mobile device gyroscope, or even have it be piloted by another script
/// By setting different speed/amplitude values for each of your UI layers, you'll be able to create a nice parallax effect
/// </summary>
public class MMParallaxUI : MonoBehaviour
{
/// <summary>
/// A class used to store layer settings
/// </summary>
[Serializable]
public class ParallaxLayer
{
/// the rect transform for this layer
public RectTransform Rect;
/// the speed at which this layer should move
public float Speed = 2f;
/// the maximum distance this layer can travel from its starting position
public float Amplitude = 50f;
/// the starting position for this layer
[HideInInspector]
public Vector2 StartPosition;
/// if this is false, this layer won't move
public bool Active = true;
/// if this is true, will force the z position of this layer to ForcedZPosition
public bool ForceZPosition = true;
/// the z position at which to force this layer to be
[MMCondition("ForceZPosition", true)]
public float ForcedZPosition = 0f;
}
/// the possible modes used to pilot this parallax rig
public enum Modes { Mouse, Gyroscope, Script }
/// the selected mode for this parallax setup. note that gyroscope mode is only available on mobile devices
public Modes Mode = Modes.Mouse;
/// a multiplier to apply to all layers' amplitudes
public float AmplitudeMultiplier = 1f;
/// a speed multiplier to apply to all layers' speeds
public float SpeedMultiplier = 1f;
/// a list of all the layers to pilot
public List<ParallaxLayer> ParallaxLayers;
protected Vector2 _referencePosition;
protected Vector3 _newPosition;
protected Vector2 _mousePosition;
/// <summary>
/// On Start we initialize our reference position
/// </summary>
protected virtual void Start()
{
Initialization();
}
/// <summary>
/// Initializes the start position of all layers
/// </summary>
public virtual void Initialization()
{
foreach (ParallaxLayer layer in ParallaxLayers)
{
layer.StartPosition = layer.Rect.position;
}
}
/// <summary>
/// On Update, moves all layers according to the selected mode
/// </summary>
protected virtual void Update()
{
MoveLayers();
}
/// <summary>
/// Computes the input data according to the selected mode, and moves the layers accordingly
/// </summary>
protected virtual void MoveLayers()
{
switch (Mode)
{
case Modes.Gyroscope:
_referencePosition = MMGyroscope.CalibratedInputAcceleration;
break;
case Modes.Mouse:
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
_mousePosition = Mouse.current.position.ReadValue();
#else
_mousePosition = Input.mousePosition;
#endif
_referencePosition = Camera.main.ScreenToViewportPoint(_mousePosition);
break;
}
foreach (ParallaxLayer layer in ParallaxLayers)
{
if (layer.Active)
{
_newPosition.x = Mathf.Lerp(layer.Rect.position.x, layer.StartPosition.x + _referencePosition.x * layer.Amplitude * AmplitudeMultiplier, layer.Speed * SpeedMultiplier * Time.deltaTime);
_newPosition.y = Mathf.Lerp(layer.Rect.position.y, layer.StartPosition.y + _referencePosition.y * layer.Amplitude * AmplitudeMultiplier, layer.Speed * SpeedMultiplier * Time.deltaTime);
_newPosition.z = 0;
layer.Rect.position = _newPosition;
if (layer.ForceZPosition)
{
Vector3 pos = layer.Rect.localPosition;
if (pos.z != 0f)
{
pos.z = 0f;
layer.Rect.localPosition = pos;
}
}
}
}
}
/// <summary>
/// Sets a new reference position, to use when in Script mode
/// </summary>
/// <param name="newReferencePosition"></param>
public virtual void SetReferencePosition(Vector3 newReferencePosition)
{
_referencePosition = newReferencePosition;
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 2852911d573562f4a836903e5c779c94
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/MMTools/Accessories/MMGUI/MMParallaxUI.cs
uploadId: 830868

View File

@@ -0,0 +1,69 @@
using UnityEngine;
#if MM_UI
using UnityEngine.UI;
#endif
using System.Collections;
using MoreMountains.Tools;
namespace MoreMountains.Tools
{
public class MMProgressBarDemoAuto : MonoBehaviour
{
public enum TestModes { Permanent, OneTime }
public TestModes TestMode = TestModes.Permanent;
[MMEnumCondition("TestMode", (int)TestModes.Permanent)]
public float CurrentValue = 0f;
[MMEnumCondition("TestMode", (int)TestModes.Permanent)]
public float MinValue = 0f;
[MMEnumCondition("TestMode", (int)TestModes.Permanent)]
public float MaxValue = 100f;
[MMEnumCondition("TestMode", (int)TestModes.Permanent)]
public float Speed = 1f;
[MMEnumCondition("TestMode", (int)TestModes.OneTime)]
public float OneTimeNewValue;
[MMEnumCondition("TestMode", (int)TestModes.OneTime)]
public float OneTimeMinValue;
[MMEnumCondition("TestMode", (int)TestModes.OneTime)]
public float OneTimeMaxValue;
[MMEnumCondition("TestMode", (int)TestModes.OneTime)]
[MMInspectorButton("OneTime")]
public bool OneTimeButton;
protected float _direction = 1f;
protected MMProgressBar _progressBar;
protected virtual void Start()
{
Initialization ();
}
protected virtual void Initialization()
{
_progressBar = GetComponent<MMProgressBar> ();
}
protected virtual void Update()
{
if (TestMode == TestModes.Permanent)
{
#if MM_UI
_progressBar.UpdateBar(CurrentValue, MinValue, MaxValue);
#endif
CurrentValue += Speed * Time.deltaTime * _direction;
if ((CurrentValue <= MinValue) || (CurrentValue >= MaxValue))
{
_direction *= -1;
}
}
}
protected virtual void OneTime()
{
#if MM_UI
_progressBar.UpdateBar(OneTimeNewValue, OneTimeMinValue, OneTimeMaxValue);
#endif
}
}
}

View File

@@ -0,0 +1,20 @@
fileFormatVersion: 2
guid: 8d6b0cf6d1d21694084a7227b664276e
timeCreated: 1523894192
licenseType: Store
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/MMTools/Accessories/MMGUI/MMProgressBarDemoAuto.cs
uploadId: 830868

View File

@@ -0,0 +1,60 @@
#if MM_UI
using System;
using UnityEngine;
using UnityEngine.UI;
namespace MoreMountains.Tools
{
/// <summary>
/// Add this class to a radial image and it'll allow you to control its fill amount
/// This is a legacy class, and it's recommended to use MMProgressBar instead, it'll provide the same functionality
/// (make sure you pick FillAmount as the FillMode)
/// and much more options, such as delayed bars, events, bump, and more!
/// </summary>
[Obsolete("This component is obsolete, it's recommended to use MMProgressBar instead", true)]
public class MMRadialProgressBar : MonoBehaviour
{
/// the start fill amount value
public float StartValue = 1f;
/// the end goad fill amount value
public float EndValue = 0f;
/// the distance to the start or end value at which the class should start lerping
public float Tolerance = 0.01f;
/// optional - the ID of the player associated to this bar
public string PlayerID;
protected Image _radialImage;
protected float _newPercent;
/// <summary>
/// On awake we grab our Image component
/// </summary>
protected virtual void Awake()
{
_radialImage = GetComponent<Image>();
}
/// <summary>
/// Call this method to update the fill amount based on a currentValue between minValue and maxValue
/// </summary>
/// <param name="currentValue">Current value.</param>
/// <param name="minValue">Minimum value.</param>
/// <param name="maxValue">Max value.</param>
public virtual void UpdateBar(float currentValue,float minValue,float maxValue)
{
_newPercent = MMMaths.Remap(currentValue,minValue,maxValue,StartValue,EndValue);
if (_radialImage == null) { return; }
_radialImage.fillAmount = _newPercent;
if (_radialImage.fillAmount > 1 - Tolerance)
{
_radialImage.fillAmount = 1;
}
if (_radialImage.fillAmount < Tolerance)
{
_radialImage.fillAmount = 0;
}
}
}
}
#endif

View File

@@ -0,0 +1,20 @@
fileFormatVersion: 2
guid: 6875477705097214296780853d481a87
timeCreated: 1523969902
licenseType: Store
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/MMTools/Accessories/MMGUI/MMRadialProgressBar.cs
uploadId: 830868

View File

@@ -0,0 +1,25 @@
using UnityEngine;
#if MM_UI
using UnityEngine.UI;
using System.Collections;
using System;
namespace MoreMountains.Tools
{
/// <summary>
/// Add this class to a UI object to have it act as a raycast target without needing an Image component
/// </summary>
[AddComponentMenu("More Mountains/Tools/GUI/MM Raycast Target")]
public class MMRaycastTarget : Graphic
{
public override void SetVerticesDirty() { return; }
public override void SetMaterialDirty() { return; }
protected override void OnPopulateMesh(VertexHelper vh)
{
vh.Clear();
return;
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: bf220d92758f9a54bae271726c599936
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/MMTools/Accessories/MMGUI/MMRaycastTarget.cs
uploadId: 830868

View File

@@ -0,0 +1,43 @@
using UnityEngine;
using UnityEngine.SceneManagement;
#if MM_UI
using UnityEngine.UI;
namespace MoreMountains.Tools
{
/// <summary>
/// This component, when added on a Text component, will display the name of the level
/// </summary>
public class MMSceneName : MonoBehaviour
{
protected Text _text;
/// <summary>
/// On Awake, stores the Text component
/// </summary>
protected virtual void Awake()
{
_text = this.gameObject.GetComponent<Text>();
}
/// <summary>
/// On Start, sets the level name
/// </summary>
protected virtual void Start()
{
SetLevelNameText();
}
/// <summary>
/// Assigns the level name to the Text
/// </summary>
public virtual void SetLevelNameText()
{
if (_text != null)
{
_text.text = SceneManager.GetActiveScene().name;
}
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: d45db69777541e74c8e5f0f820540601
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/MMTools/Accessories/MMGUI/MMSceneName.cs
uploadId: 830868

View File

@@ -0,0 +1,17 @@
using UnityEngine;
using System.Collections;
using System;
namespace MoreMountains.Tools
{
[SelectionBase]
/// <summary>
/// Add this component to an object and it'll always get selection in scene view, even if you select one of its children
/// </summary>
[AddComponentMenu("More Mountains/Tools/GUI/MM Selection Base")]
public class MMSelectionBase : MonoBehaviour
{
}
}

View File

@@ -0,0 +1,20 @@
fileFormatVersion: 2
guid: 0617763b4190c364093ae8e7b62aea45
timeCreated: 1523894192
licenseType: Store
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/MMTools/Accessories/MMGUI/MMSelectionBase.cs
uploadId: 830868

View File

@@ -0,0 +1,57 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
#if MM_UI
using UnityEngine.UI;
namespace MoreMountains.Tools
{
/// <summary>
/// Add this class to a UI slider and it'll let you trigger events when the cursor moves past a certain step
/// </summary>
[AddComponentMenu("More Mountains/Tools/GUI/MM Slider Step")]
[RequireComponent(typeof(Slider))]
public class MMSliderStep : MonoBehaviour
{
[Header("Slider Step")]
/// the threshold to trigger steps at
public float StepThreshold = 0.1f;
/// the event to trigger when a step is met
public UnityEvent OnStep;
protected Slider _slider;
protected float _lastStep = 0f;
/// <summary>
/// On enable, starts listening for value change events
/// </summary>
protected virtual void OnEnable()
{
_slider = this.gameObject.GetComponent<Slider>();
_slider.onValueChanged.AddListener(ValueChangeCheck);
}
/// <summary>
/// On disable, stops listening for value change events
/// </summary>
protected virtual void OnDisable()
{
_slider.onValueChanged.RemoveListener(ValueChangeCheck);
}
/// <summary>
/// when a value change is met, we trigger an event
/// </summary>
/// <param name="value"></param>
public virtual void ValueChangeCheck(float value)
{
if (Mathf.Abs(_slider.value - _lastStep) > StepThreshold)
{
_lastStep = _slider.value;
OnStep?.Invoke();
}
}
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: e6b7fc2cafd170f4f8b039b213b568c6
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/MMTools/Accessories/MMGUI/MMSliderStep.cs
uploadId: 830868

View File

@@ -0,0 +1,136 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace MoreMountains.Tools
{
/// <summary>
/// This class lets you define an axis on which to flip a "two sided" UI element (made of two separate and usually aligned objects, effectively turning each side on/off everytime the container's scale goes above/below a certain threshold
/// </summary>
[ExecuteAlways]
public class MMTwoSidedUI : MonoBehaviour
{
/// the possible axis on which to flip the double object
public enum Axis { x, y, z }
[Header("Bindings")]
/// the object to consider as the "front" of the two sided element. Will be visible if the scale is above the threshold
public GameObject Front;
/// the object to consider as the "back" of the two sided element. Will be visible if the scale is below the threshold
public GameObject Back;
[Header("Axis")]
/// the axis on which to flip this object
public Axis FlipAxis;
/// the scale threshold at which the flip should occur
public float ScaleThreshold = 0f;
[Header("Events")]
/// an event to invoke on flip
public UnityEvent OnFlip;
[Header("Debug")]
/// whether or not we're in debug mode
public bool DebugMode;
/// the value to apply to the scale when in debug mode
[Range(-1f, 1f)]
public float ScaleValue;
/// whether or not our object is flipped right now
[MMReadOnly]
public bool BackVisible = false;
protected RectTransform _rectTransform;
protected bool _initialized = false;
/// <summary>
/// On Start we initialize our object
/// </summary>
protected virtual void Start()
{
Initialization();
}
/// <summary>
/// On init we grab our rect transform and initialize visibility
/// </summary>
protected virtual void Initialization()
{
_rectTransform = this.gameObject.GetComponent<RectTransform>();
_initialized = true;
float axis = GetScaleValue();
BackVisible = (axis < ScaleThreshold);
Front.SetActive(!BackVisible);
Back.SetActive(BackVisible);
}
/// <summary>
/// On Update we update visibility if needed
/// </summary>
protected virtual void Update()
{
#if UNITY_EDITOR
IfEditor();
#endif
float axis = GetScaleValue();
if ((axis < ScaleThreshold) != BackVisible)
{
Front.SetActive(BackVisible);
Back.SetActive(!BackVisible);
OnFlip?.Invoke();
}
BackVisible = (axis < ScaleThreshold);
}
/// <summary>
/// If in editor, we initialize if needed, and apply the debug scale value if needed
/// </summary>
protected virtual void IfEditor()
{
if (!_initialized)
{
Initialization();
}
if (DebugMode)
{
switch (FlipAxis)
{
case Axis.x:
_rectTransform.localScale = new Vector3(ScaleValue, _rectTransform.localScale.y, _rectTransform.localScale.z);
break;
case Axis.y:
_rectTransform.localScale = new Vector3(_rectTransform.localScale.x, ScaleValue, _rectTransform.localScale.z);
break;
case Axis.z:
_rectTransform.localScale = new Vector3(_rectTransform.localScale.x, _rectTransform.localScale.y, ScaleValue);
break;
}
}
}
/// <summary>
/// Returns the scale of the selected axis
/// </summary>
/// <returns></returns>
protected virtual float GetScaleValue()
{
switch (FlipAxis)
{
case Axis.x:
return _rectTransform.localScale.x;
case Axis.y:
return _rectTransform.localScale.y;
case Axis.z:
return _rectTransform.localScale.z;
}
return 0f;
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: e4c4ad5c65605834a8f3d6718580bd06
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/MMTools/Accessories/MMGUI/MMTwoSidedUI.cs
uploadId: 830868

View File

@@ -0,0 +1,28 @@
using UnityEngine;
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
using UnityEngine.InputSystem;
#endif
namespace MoreMountains.Tools
{
/// <summary>
/// This component will let you have a UI object follow the mouse position
/// </summary>
public class MMUIFollowMouse : MonoBehaviour
{
public virtual Canvas TargetCanvas { get; set; }
protected Vector2 _newPosition;
protected Vector2 _mousePosition;
protected virtual void LateUpdate()
{
#if !ENABLE_INPUT_SYSTEM || ENABLE_LEGACY_INPUT_MANAGER
_mousePosition = Input.mousePosition;
#else
_mousePosition = Mouse.current.position.ReadValue();
#endif
RectTransformUtility.ScreenPointToLocalPointInRectangle(TargetCanvas.transform as RectTransform, _mousePosition, TargetCanvas.worldCamera, out _newPosition);
transform.position = TargetCanvas.transform.TransformPoint(_newPosition);
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 245a91b1a8b30dc479ea9c354ba36cb8
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/MMTools/Accessories/MMGUI/MMUIFollowMouse.cs
uploadId: 830868

View File

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

View File

@@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: MMFaderRoundMaterialMask
m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: UNITY_UI_ALPHACLIP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 0
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 1
- _StencilComp: 8
- _StencilOp: 2
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 1
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: d9497e52f2de0254eaec18ccb13d788f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMTools/Accessories/MMGUI/Materials/MMFaderRoundMaterialMask.mat
uploadId: 830868

View File

@@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: MMFaderRoundMaterialMasked
m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 2
- _StencilComp: 3
- _StencilOp: 0
- _StencilReadMask: 1
- _StencilWriteMask: 0
- _UVSec: 0
- _UseUIAlphaClip: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 1297af1e1808f5a48b35411d71934370
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMTools/Accessories/MMGUI/Materials/MMFaderRoundMaterialMasked.mat
uploadId: 830868

View File

@@ -0,0 +1,17 @@
using UnityEngine;
using System.Collections;
using System;
namespace MoreMountains.Tools
{
[SelectionBase]
/// <summary>
/// Add this component to an object and it'll always get selection in scene view, even if you select one of its children
/// </summary>
[AddComponentMenu("More Mountains/Tools/GUI/Selection Base")]
public class SelectionBase : MonoBehaviour
{
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: ca4c1ca8bc423b748983b24393521cb7
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/MMTools/Accessories/MMGUI/SelectionBase.cs
uploadId: 830868

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,147 @@
fileFormatVersion: 2
guid: 47332880f10dee4429534303790a8399
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 1
swizzle: 50462976
cookieLightType: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 1cf89cd354fd1624b96d70e690de2f01
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMTools/Accessories/MMGUI/Sprites/MMFaderRoundMask.png
uploadId: 830868

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

View File

@@ -0,0 +1,147 @@
fileFormatVersion: 2
guid: aff4855d499cb7646b344323f4129b58
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 1
swizzle: 50462976
cookieLightType: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.9.1
assetPath: Assets/Feel/MMTools/Accessories/MMGUI/Sprites/MMTools_GUI_1x1.png
uploadId: 830868