Passion & UI
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Video;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.UI.Shift
|
||||
{
|
||||
[CreateAssetMenu(fileName = "New UI Manager", menuName = "Shift UI/New UI Manager")]
|
||||
public class UIManager : ScriptableObject
|
||||
{
|
||||
[HideInInspector] public bool enableDynamicUpdate = true;
|
||||
[HideInInspector] public bool enableExtendedColorPicker = true;
|
||||
[HideInInspector] public bool editorHints = true;
|
||||
|
||||
// [Header("BACKGROUND")]
|
||||
public Color backgroundColorTint = new Color(255, 255, 255, 255);
|
||||
public BackgroundType backgroundType;
|
||||
public Sprite backgroundImage;
|
||||
public VideoClip backgroundVideo;
|
||||
public bool backgroundPreserveAspect;
|
||||
[Range(0.1f, 5)] public float backgroundSpeed = 1;
|
||||
|
||||
// [Header("COLORS")]
|
||||
public Color primaryColor = new Color(255, 255, 255, 255);
|
||||
public Color secondaryColor = new Color(255, 255, 255, 255);
|
||||
public Color primaryReversed = new Color(255, 255, 255, 255);
|
||||
public Color negativeColor = new Color(255, 255, 255, 255);
|
||||
public Color backgroundColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// [Header("FONTS")]
|
||||
public TMP_FontAsset lightFont;
|
||||
public TMP_FontAsset regularFont;
|
||||
public TMP_FontAsset mediumFont;
|
||||
public TMP_FontAsset semiBoldFont;
|
||||
public TMP_FontAsset boldFont;
|
||||
|
||||
// [Header("LOGO")]
|
||||
public Sprite gameLogo;
|
||||
public Color logoColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// [Header("PARTICLES")]
|
||||
public Color particleColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// [Header("SOUNDS")]
|
||||
public AudioClip backgroundMusic;
|
||||
public AudioClip hoverSound;
|
||||
public AudioClip clickSound;
|
||||
|
||||
public enum ButtonThemeType
|
||||
{
|
||||
BASIC,
|
||||
CUSTOM
|
||||
}
|
||||
|
||||
public enum BackgroundType
|
||||
{
|
||||
BASIC,
|
||||
ADVANCED
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9aabd12c6a06b464ba68864f87a71c02
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: a1559c6a1930beb469beaff5050f4d02, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 157943
|
||||
packageName: Shift - Complete Sci-Fi UI
|
||||
packageVersion: 2.0.12
|
||||
assetPath: Assets/Shift - Complete Sci-Fi UI/Scripts/UI Manager/UIManager.cs
|
||||
uploadId: 915518
|
||||
@@ -0,0 +1,55 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Michsky.UI.Shift
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerBGMusic : MonoBehaviour
|
||||
{
|
||||
[Header("Resources")]
|
||||
public UIManager UIManagerAsset;
|
||||
public AudioSource audioObject;
|
||||
|
||||
bool dynamicUpdateEnabled;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (UIManagerAsset == null)
|
||||
{
|
||||
try { UIManagerAsset = Resources.Load<UIManager>("Shift UI Manager"); }
|
||||
catch { Debug.Log("No UI Manager found. Assign it manually, otherwise it won't work properly.", this); }
|
||||
}
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (dynamicUpdateEnabled == false)
|
||||
{
|
||||
this.enabled = true;
|
||||
UpdateSource();
|
||||
}
|
||||
|
||||
if (audioObject == null)
|
||||
audioObject = gameObject.GetComponent<AudioSource>();
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (UIManagerAsset != null)
|
||||
{
|
||||
if (UIManagerAsset.enableDynamicUpdate == true)
|
||||
dynamicUpdateEnabled = true;
|
||||
else
|
||||
dynamicUpdateEnabled = false;
|
||||
|
||||
if (dynamicUpdateEnabled == true)
|
||||
UpdateSource();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateSource()
|
||||
{
|
||||
try { audioObject.clip = UIManagerAsset.backgroundMusic; }
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a4a9b5895f870a4c8b8750949a519ad
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 157943
|
||||
packageName: Shift - Complete Sci-Fi UI
|
||||
packageVersion: 2.0.12
|
||||
assetPath: Assets/Shift - Complete Sci-Fi UI/Scripts/UI Manager/UIManagerBGMusic.cs
|
||||
uploadId: 915518
|
||||
@@ -0,0 +1,123 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Video;
|
||||
|
||||
namespace Michsky.UI.Shift
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerBackground : MonoBehaviour
|
||||
{
|
||||
[Header("Resources")]
|
||||
public UIManager UIManagerAsset;
|
||||
Image backgroundObject;
|
||||
RawImage backgroundVideoImage;
|
||||
VideoPlayer backgroundVideo;
|
||||
|
||||
[Header("Settings")]
|
||||
public BackgroundType backgroundType;
|
||||
public bool enableMobileMode = false;
|
||||
|
||||
bool dynamicUpdateEnabled;
|
||||
|
||||
public enum BackgroundType
|
||||
{
|
||||
BASIC,
|
||||
ADVANCED
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (UIManagerAsset == null)
|
||||
{
|
||||
try { UIManagerAsset = Resources.Load<UIManager>("Shift UI Manager"); }
|
||||
catch { Debug.Log("No UI Manager found. Assign it manually, otherwise it won't work properly.", this); }
|
||||
}
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (dynamicUpdateEnabled == false)
|
||||
{
|
||||
this.enabled = true;
|
||||
UpdateBackground();
|
||||
}
|
||||
|
||||
if (backgroundObject == null && backgroundType == BackgroundType.BASIC)
|
||||
backgroundObject = gameObject.GetComponent<Image>();
|
||||
|
||||
else if (backgroundVideo == null && backgroundType == BackgroundType.ADVANCED)
|
||||
{
|
||||
backgroundVideo = gameObject.GetComponent<VideoPlayer>();
|
||||
backgroundVideoImage = gameObject.GetComponent<RawImage>();
|
||||
}
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (UIManagerAsset != null)
|
||||
{
|
||||
if (UIManagerAsset.enableDynamicUpdate == true)
|
||||
dynamicUpdateEnabled = true;
|
||||
else
|
||||
dynamicUpdateEnabled = false;
|
||||
|
||||
if (dynamicUpdateEnabled == true)
|
||||
UpdateBackground();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateBackground()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (enableMobileMode == true)
|
||||
{
|
||||
if (backgroundType == BackgroundType.BASIC)
|
||||
{
|
||||
backgroundObject.enabled = true;
|
||||
backgroundObject.sprite = UIManagerAsset.backgroundImage;
|
||||
backgroundObject.color = UIManagerAsset.backgroundColorTint;
|
||||
backgroundObject.preserveAspect = UIManagerAsset.backgroundPreserveAspect;
|
||||
}
|
||||
|
||||
if (backgroundType == BackgroundType.ADVANCED)
|
||||
{
|
||||
backgroundVideo.enabled = false;
|
||||
backgroundVideoImage.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (UIManagerAsset.backgroundType == UIManager.BackgroundType.ADVANCED && backgroundType == BackgroundType.ADVANCED)
|
||||
{
|
||||
backgroundVideo.enabled = true;
|
||||
backgroundVideoImage.enabled = true;
|
||||
backgroundVideo.clip = UIManagerAsset.backgroundVideo;
|
||||
backgroundVideoImage.color = UIManagerAsset.backgroundColorTint;
|
||||
backgroundVideo.playbackSpeed = UIManagerAsset.backgroundSpeed;
|
||||
}
|
||||
|
||||
else if (UIManagerAsset.backgroundType == UIManager.BackgroundType.BASIC && backgroundType == BackgroundType.BASIC)
|
||||
{
|
||||
backgroundObject.enabled = true;
|
||||
backgroundObject.sprite = UIManagerAsset.backgroundImage;
|
||||
backgroundObject.color = UIManagerAsset.backgroundColorTint;
|
||||
backgroundObject.preserveAspect = UIManagerAsset.backgroundPreserveAspect;
|
||||
}
|
||||
|
||||
else if (UIManagerAsset.backgroundType == UIManager.BackgroundType.BASIC && backgroundType == BackgroundType.ADVANCED)
|
||||
{
|
||||
backgroundVideo.enabled = false;
|
||||
backgroundVideoImage.enabled = false;
|
||||
}
|
||||
|
||||
else if (UIManagerAsset.backgroundType == UIManager.BackgroundType.ADVANCED && backgroundType == BackgroundType.BASIC)
|
||||
backgroundObject.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c97f6ce019d38a419623dcf44c0be56
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 157943
|
||||
packageName: Shift - Complete Sci-Fi UI
|
||||
packageVersion: 2.0.12
|
||||
assetPath: Assets/Shift - Complete Sci-Fi UI/Scripts/UI Manager/UIManagerBackground.cs
|
||||
uploadId: 915518
|
||||
@@ -0,0 +1,73 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Michsky.UI.Shift
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerGameLogo : MonoBehaviour
|
||||
{
|
||||
[Header("Resources")]
|
||||
public UIManager UIManagerAsset;
|
||||
public Image logoObject;
|
||||
|
||||
[Header("Settings")]
|
||||
public bool keepAlphaValue = false;
|
||||
public bool useCustomColor = false;
|
||||
|
||||
bool dynamicUpdateEnabled;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (UIManagerAsset == null)
|
||||
{
|
||||
try { UIManagerAsset = Resources.Load<UIManager>("Shift UI Manager"); }
|
||||
catch { Debug.Log("No UI Manager found. Assign it manually, otherwise it won't work properly.", this); }
|
||||
}
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (dynamicUpdateEnabled == false)
|
||||
{
|
||||
this.enabled = true;
|
||||
UpdateLogo();
|
||||
}
|
||||
|
||||
if (logoObject == null)
|
||||
logoObject = gameObject.GetComponent<Image>();
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (UIManagerAsset != null)
|
||||
{
|
||||
if (UIManagerAsset.enableDynamicUpdate == true)
|
||||
dynamicUpdateEnabled = true;
|
||||
else
|
||||
dynamicUpdateEnabled = false;
|
||||
|
||||
if (dynamicUpdateEnabled == true)
|
||||
UpdateLogo();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateLogo()
|
||||
{
|
||||
try
|
||||
{
|
||||
logoObject.sprite = UIManagerAsset.gameLogo;
|
||||
|
||||
if (useCustomColor == false)
|
||||
{
|
||||
if (keepAlphaValue == false)
|
||||
logoObject.color = UIManagerAsset.logoColor;
|
||||
|
||||
else
|
||||
logoObject.color = new Color(UIManagerAsset.logoColor.r, UIManagerAsset.logoColor.g, UIManagerAsset.logoColor.b, logoObject.color.a);
|
||||
}
|
||||
}
|
||||
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1259994055111f14ea38edd94f0ced36
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 157943
|
||||
packageName: Shift - Complete Sci-Fi UI
|
||||
packageVersion: 2.0.12
|
||||
assetPath: Assets/Shift - Complete Sci-Fi UI/Scripts/UI Manager/UIManagerGameLogo.cs
|
||||
uploadId: 915518
|
||||
@@ -0,0 +1,101 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Michsky.UI.Shift
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerImage : MonoBehaviour
|
||||
{
|
||||
[Header("Resources")]
|
||||
public UIManager UIManagerAsset;
|
||||
public Image imageObject;
|
||||
|
||||
[Header("Settings")]
|
||||
public bool keepAlphaValue = false;
|
||||
public bool useCustomColor = false;
|
||||
public ColorType colorType;
|
||||
|
||||
bool dynamicUpdateEnabled;
|
||||
|
||||
public enum ColorType
|
||||
{
|
||||
Primary,
|
||||
Secondary,
|
||||
PrimaryReversed,
|
||||
Negative,
|
||||
Background
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (UIManagerAsset == null)
|
||||
{
|
||||
try { UIManagerAsset = Resources.Load<UIManager>("Shift UI Manager"); }
|
||||
catch { Debug.Log("No UI Manager found. Assign it manually, otherwise it won't work properly.", this); }
|
||||
}
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (dynamicUpdateEnabled == false)
|
||||
{
|
||||
this.enabled = true;
|
||||
UpdateButton();
|
||||
}
|
||||
|
||||
if (imageObject == null)
|
||||
imageObject = gameObject.GetComponent<Image>();
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (UIManagerAsset != null)
|
||||
{
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { dynamicUpdateEnabled = true; }
|
||||
else { dynamicUpdateEnabled = false; }
|
||||
|
||||
if (dynamicUpdateEnabled == true)
|
||||
UpdateButton();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateButton()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (useCustomColor == false)
|
||||
{
|
||||
if (keepAlphaValue == false)
|
||||
{
|
||||
if (colorType == ColorType.Primary)
|
||||
imageObject.color = UIManagerAsset.primaryColor;
|
||||
else if (colorType == ColorType.Secondary)
|
||||
imageObject.color = UIManagerAsset.secondaryColor;
|
||||
else if (colorType == ColorType.PrimaryReversed)
|
||||
imageObject.color = UIManagerAsset.primaryReversed;
|
||||
else if (colorType == ColorType.Negative)
|
||||
imageObject.color = UIManagerAsset.negativeColor;
|
||||
else if (colorType == ColorType.Background)
|
||||
imageObject.color = UIManagerAsset.backgroundColor;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (colorType == ColorType.Primary)
|
||||
imageObject.color = new Color(UIManagerAsset.primaryColor.r, UIManagerAsset.primaryColor.g, UIManagerAsset.primaryColor.b, imageObject.color.a);
|
||||
else if (colorType == ColorType.Secondary)
|
||||
imageObject.color = new Color(UIManagerAsset.secondaryColor.r, UIManagerAsset.secondaryColor.g, UIManagerAsset.secondaryColor.b, imageObject.color.a);
|
||||
else if (colorType == ColorType.PrimaryReversed)
|
||||
imageObject.color = new Color(UIManagerAsset.primaryReversed.r, UIManagerAsset.primaryReversed.g, UIManagerAsset.primaryReversed.b, imageObject.color.a);
|
||||
else if (colorType == ColorType.Negative)
|
||||
imageObject.color = new Color(UIManagerAsset.negativeColor.r, UIManagerAsset.negativeColor.g, UIManagerAsset.negativeColor.b, imageObject.color.a);
|
||||
else if (colorType == ColorType.Background)
|
||||
imageObject.color = new Color(UIManagerAsset.backgroundColor.r, UIManagerAsset.backgroundColor.g, UIManagerAsset.backgroundColor.b, imageObject.color.a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f12069492762c9048b6c2edda60be228
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 157943
|
||||
packageName: Shift - Complete Sci-Fi UI
|
||||
packageVersion: 2.0.12
|
||||
assetPath: Assets/Shift - Complete Sci-Fi UI/Scripts/UI Manager/UIManagerImage.cs
|
||||
uploadId: 915518
|
||||
@@ -0,0 +1,60 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Michsky.UI.Shift
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerParticle : MonoBehaviour
|
||||
{
|
||||
[Header("Resources")]
|
||||
public UIManager UIManagerAsset;
|
||||
public ParticleSystem particleObject;
|
||||
|
||||
bool dynamicUpdateEnabled;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (UIManagerAsset == null)
|
||||
{
|
||||
try { UIManagerAsset = Resources.Load<UIManager>("Shift UI Manager"); }
|
||||
catch { Debug.Log("No UI Manager found. Assign it manually, otherwise it won't work properly.", this); }
|
||||
}
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (dynamicUpdateEnabled == false)
|
||||
{
|
||||
this.enabled = true;
|
||||
UpdateColor();
|
||||
}
|
||||
|
||||
if (particleObject == null)
|
||||
particleObject = gameObject.GetComponent<ParticleSystem>();
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (UIManagerAsset != null)
|
||||
{
|
||||
if (UIManagerAsset.enableDynamicUpdate == true)
|
||||
dynamicUpdateEnabled = true;
|
||||
else
|
||||
dynamicUpdateEnabled = false;
|
||||
|
||||
if (dynamicUpdateEnabled == true)
|
||||
UpdateColor();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateColor()
|
||||
{
|
||||
try
|
||||
{
|
||||
var main = particleObject.main;
|
||||
main.startColor = new Color(UIManagerAsset.particleColor.r, UIManagerAsset.particleColor.g, UIManagerAsset.particleColor.b, main.startColor.color.a);
|
||||
}
|
||||
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65ef32c036ad24b47be490520a7ba55d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 157943
|
||||
packageName: Shift - Complete Sci-Fi UI
|
||||
packageVersion: 2.0.12
|
||||
assetPath: Assets/Shift - Complete Sci-Fi UI/Scripts/UI Manager/UIManagerParticle.cs
|
||||
uploadId: 915518
|
||||
@@ -0,0 +1,126 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.UI.Shift
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerText : MonoBehaviour
|
||||
{
|
||||
[Header("Resources")]
|
||||
public UIManager UIManagerAsset;
|
||||
public TextMeshProUGUI textObject;
|
||||
|
||||
[Header("Settings")]
|
||||
public bool keepAlphaValue = false;
|
||||
public bool useCustomColor = false;
|
||||
public ColorType colorType;
|
||||
public FontType fontType;
|
||||
|
||||
bool dynamicUpdateEnabled;
|
||||
|
||||
public enum ColorType
|
||||
{
|
||||
Primary,
|
||||
Secondary,
|
||||
PrimaryReversed,
|
||||
Negative,
|
||||
Background
|
||||
}
|
||||
|
||||
public enum FontType
|
||||
{
|
||||
Light,
|
||||
Regular,
|
||||
Medium,
|
||||
Semibold,
|
||||
Bold
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (UIManagerAsset == null)
|
||||
{
|
||||
try { UIManagerAsset = Resources.Load<UIManager>("Shift UI Manager"); }
|
||||
catch { Debug.Log("No UI Manager found. Assign it manually, otherwise it won't work properly.", this); }
|
||||
}
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (dynamicUpdateEnabled == false)
|
||||
{
|
||||
this.enabled = true;
|
||||
UpdateButton();
|
||||
}
|
||||
|
||||
if (textObject == null)
|
||||
textObject = gameObject.GetComponent<TextMeshProUGUI>();
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (UIManagerAsset != null)
|
||||
{
|
||||
if (UIManagerAsset.enableDynamicUpdate == true)
|
||||
dynamicUpdateEnabled = true;
|
||||
else
|
||||
dynamicUpdateEnabled = false;
|
||||
|
||||
if (dynamicUpdateEnabled == true)
|
||||
UpdateButton();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateButton()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Colors
|
||||
if (useCustomColor == false)
|
||||
{
|
||||
if (keepAlphaValue == false)
|
||||
{
|
||||
if (colorType == ColorType.Primary)
|
||||
textObject.color = UIManagerAsset.primaryColor;
|
||||
else if (colorType == ColorType.Secondary)
|
||||
textObject.color = UIManagerAsset.secondaryColor;
|
||||
else if (colorType == ColorType.PrimaryReversed)
|
||||
textObject.color = UIManagerAsset.primaryReversed;
|
||||
else if (colorType == ColorType.Negative)
|
||||
textObject.color = UIManagerAsset.negativeColor;
|
||||
else if (colorType == ColorType.Background)
|
||||
textObject.color = UIManagerAsset.backgroundColor;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (colorType == ColorType.Primary)
|
||||
textObject.color = new Color(UIManagerAsset.primaryColor.r, UIManagerAsset.primaryColor.g, UIManagerAsset.primaryColor.b, textObject.color.a);
|
||||
else if (colorType == ColorType.Secondary)
|
||||
textObject.color = new Color(UIManagerAsset.secondaryColor.r, UIManagerAsset.secondaryColor.g, UIManagerAsset.secondaryColor.b, textObject.color.a);
|
||||
else if (colorType == ColorType.PrimaryReversed)
|
||||
textObject.color = new Color(UIManagerAsset.primaryReversed.r, UIManagerAsset.primaryReversed.g, UIManagerAsset.primaryReversed.b, textObject.color.a);
|
||||
else if (colorType == ColorType.Negative)
|
||||
textObject.color = new Color(UIManagerAsset.negativeColor.r, UIManagerAsset.negativeColor.g, UIManagerAsset.negativeColor.b, textObject.color.a);
|
||||
else if (colorType == ColorType.Background)
|
||||
textObject.color = new Color(UIManagerAsset.backgroundColor.r, UIManagerAsset.backgroundColor.g, UIManagerAsset.backgroundColor.b, textObject.color.a);
|
||||
}
|
||||
}
|
||||
|
||||
// Fonts
|
||||
if (fontType == FontType.Light)
|
||||
textObject.font = UIManagerAsset.lightFont;
|
||||
else if (fontType == FontType.Regular)
|
||||
textObject.font = UIManagerAsset.regularFont;
|
||||
else if (fontType == FontType.Medium)
|
||||
textObject.font = UIManagerAsset.mediumFont;
|
||||
else if (fontType == FontType.Semibold)
|
||||
textObject.font = UIManagerAsset.semiBoldFont;
|
||||
else if (fontType == FontType.Bold)
|
||||
textObject.font = UIManagerAsset.boldFont;
|
||||
}
|
||||
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e53da8c190fcc64693a9a03b09347e3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 157943
|
||||
packageName: Shift - Complete Sci-Fi UI
|
||||
packageVersion: 2.0.12
|
||||
assetPath: Assets/Shift - Complete Sci-Fi UI/Scripts/UI Manager/UIManagerText.cs
|
||||
uploadId: 915518
|
||||
Reference in New Issue
Block a user