Imported UI Assets

This commit is contained in:
MarcoHampel
2024-02-01 22:45:59 -05:00
parent 95a3f673f0
commit 5192d8b669
1355 changed files with 518302 additions and 153 deletions

View File

@ -0,0 +1,15 @@
using UnityEngine;
namespace Michsky.UI.Heat
{
public class ExitGame : MonoBehaviour
{
public void Exit()
{
Application.Quit();
#if UNITY_EDITOR
Debug.Log("<b>[Heat UI]</b> Exit function works in builds only.");
#endif
}
}
}

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 4eb34af862900dd4194a0b90bdfadd5a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: ee083492dcf46e24daded170502f8f55, type: 3}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 264857
packageName: Heat - Complete Modern UI
packageVersion: 1.0.4
assetPath: Assets/Heat - Complete Modern UI/Scripts/Misc/ExitGame.cs
uploadId: 629893

View File

@ -0,0 +1,55 @@
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
namespace Michsky.UI.Heat
{
[ExecuteInEditMode]
[DisallowMultipleComponent]
[AddComponentMenu("Heat UI/Layout/Layout Group Fix")]
public class LayoutGroupFix : MonoBehaviour
{
[SerializeField] private bool fixOnEnable = true;
[SerializeField] private bool fixWithDelay = true;
[SerializeField] private RebuildMethod rebuildMethod;
float fixDelay = 0.025f;
public enum RebuildMethod { ForceRebuild, MarkRebuild }
void OnEnable()
{
#if UNITY_EDITOR
LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent<RectTransform>());
if (Application.isPlaying == false) { return; }
#endif
if (fixWithDelay == false && fixOnEnable == true && rebuildMethod == RebuildMethod.ForceRebuild) { ForceRebuild(); }
else if (fixWithDelay == false && fixOnEnable == true && rebuildMethod == RebuildMethod.MarkRebuild) { MarkRebuild(); }
else if (fixWithDelay == true) { StartCoroutine(FixDelay()); }
}
public void FixLayout()
{
if (fixWithDelay == false && rebuildMethod == RebuildMethod.ForceRebuild) { ForceRebuild(); }
else if (fixWithDelay == false && rebuildMethod == RebuildMethod.MarkRebuild) { MarkRebuild(); }
else { StartCoroutine(FixDelay()); }
}
void ForceRebuild()
{
LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent<RectTransform>());
}
void MarkRebuild()
{
LayoutRebuilder.MarkLayoutForRebuild(GetComponent<RectTransform>());
}
IEnumerator FixDelay()
{
yield return new WaitForSecondsRealtime(fixDelay);
if (rebuildMethod == RebuildMethod.ForceRebuild) { ForceRebuild(); }
else if (rebuildMethod == RebuildMethod.MarkRebuild) { MarkRebuild(); }
}
}
}

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 85c3ffc60b948b3449219ed60c049394
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: ee083492dcf46e24daded170502f8f55, type: 3}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 264857
packageName: Heat - Complete Modern UI
packageVersion: 1.0.4
assetPath: Assets/Heat - Complete Modern UI/Scripts/Misc/LayoutGroupFix.cs
uploadId: 629893

View File

@ -0,0 +1,56 @@
using System.Collections;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
namespace Michsky.UI.Heat
{
[RequireComponent(typeof(TextMeshProUGUI))]
[AddComponentMenu("Heat UI/Misc/Text Time Counter")]
public class TextTimeCounter : MonoBehaviour
{
TextMeshProUGUI tmpText;
RectTransform tmpRect;
int minutes;
float seconds;
void OnEnable()
{
if (tmpText == null) { tmpText = GetComponent<TextMeshProUGUI>(); }
if (tmpRect == null) { tmpRect = tmpText.GetComponent<RectTransform>(); }
ResetTimer();
}
public void ResetTimer()
{
minutes = 0;
seconds = 0;
tmpText.text = "0:00";
StopCoroutine("Count");
StartCoroutine("Count");
}
IEnumerator Count()
{
while (true)
{
if (seconds == 60)
{
seconds = 0;
minutes++;
}
if (seconds < 10) { tmpText.text = minutes.ToString() + ":0" + seconds.ToString("F0"); }
else { tmpText.text = minutes.ToString() + ":" + seconds.ToString("F0"); }
LayoutRebuilder.ForceRebuildLayoutImmediate(tmpRect);
seconds++;
yield return new WaitForSeconds(1);
}
}
}
}

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: ca1b6779c2a2c8b4695a1e7f68da4d5f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: ee083492dcf46e24daded170502f8f55, type: 3}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 264857
packageName: Heat - Complete Modern UI
packageVersion: 1.0.4
assetPath: Assets/Heat - Complete Modern UI/Scripts/Misc/TextTimeCounter.cs
uploadId: 629893