基础内容
必要插件安装 缓动曲线和动画基础 ElementFolder,Track与其次级模块,PathNode重构
This commit is contained in:
116
Assets/Modern UI Pack/Scripts/UI Manager/UIManager.cs
Normal file
116
Assets/Modern UI Pack/Scripts/UI Manager/UIManager.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[CreateAssetMenu(fileName = "New UI Manager", menuName = "Modern UI Pack/New UI Manager")]
|
||||
public class UIManager : ScriptableObject
|
||||
{
|
||||
// Settings
|
||||
[HideInInspector] public bool enableDynamicUpdate = true;
|
||||
[HideInInspector] public bool enableExtendedColorPicker = true;
|
||||
[HideInInspector] public bool editorHints = true;
|
||||
|
||||
// Animated Icon
|
||||
public Color animatedIconColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Context Menu
|
||||
public Color contextBackgroundColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Button
|
||||
public TMP_FontAsset buttonFont;
|
||||
public Color buttonNormalColor = new Color(255, 255, 255, 255);
|
||||
public Color buttonAccentColor = new Color(255, 255, 255, 255);
|
||||
[Range(0, 1)] public float buttonDisabledAlpha = 0.4f;
|
||||
|
||||
// Dropdown
|
||||
public TMP_FontAsset dropdownFont;
|
||||
public TMP_FontAsset dropdownItemFont;
|
||||
public Color dropdownBackgroundColor = new Color(255, 255, 255, 255);
|
||||
public Color dropdownContentBackgroundColor = new Color(255, 255, 255, 255);
|
||||
public Color dropdownPrimaryColor = new Color(255, 255, 255, 255);
|
||||
public Color dropdownItemBackgroundColor = new Color(255, 255, 255, 255);
|
||||
public Color dropdownItemPrimaryColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Horizontal Selector
|
||||
public TMP_FontAsset selectorFont;
|
||||
public Color selectorColor = new Color(255, 255, 255, 255);
|
||||
public Color selectorHighlightedColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Input Field
|
||||
public TMP_FontAsset inputFieldFont;
|
||||
public Color inputFieldColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Modal Window
|
||||
public TMP_FontAsset modalWindowTitleFont;
|
||||
public TMP_FontAsset modalWindowContentFont;
|
||||
public Color modalWindowTitleColor = new Color(255, 255, 255, 255);
|
||||
public Color modalWindowDescriptionColor = new Color(255, 255, 255, 255);
|
||||
public Color modalWindowIconColor = new Color(255, 255, 255, 255);
|
||||
public Color modalWindowBackgroundColor = new Color(255, 255, 255, 255);
|
||||
public Color modalWindowContentPanelColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Notification
|
||||
public TMP_FontAsset notificationTitleFont;
|
||||
public float notificationTitleFontSize = 22.5f;
|
||||
public TMP_FontAsset notificationDescriptionFont;
|
||||
public float notificationDescriptionFontSize = 18;
|
||||
public NotificationThemeType notificationThemeType;
|
||||
public Color notificationBackgroundColor = new Color(255, 255, 255, 255);
|
||||
public Color notificationTitleColor = new Color(255, 255, 255, 255);
|
||||
public Color notificationDescriptionColor = new Color(255, 255, 255, 255);
|
||||
public Color notificationIconColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Progress Bar
|
||||
public TMP_FontAsset progressBarLabelFont;
|
||||
public float progressBarLabelFontSize = 25;
|
||||
public Color progressBarColor = new Color(255, 255, 255, 255);
|
||||
public Color progressBarBackgroundColor = new Color(255, 255, 255, 255);
|
||||
public Color progressBarLoopBackgroundColor = new Color(255, 255, 255, 255);
|
||||
public Color progressBarLabelColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Scrollbar
|
||||
public Color scrollbarColor = new Color(255, 255, 255, 255);
|
||||
public Color scrollbarBackgroundColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Slider
|
||||
public TMP_FontAsset sliderLabelFont;
|
||||
public SliderThemeType sliderThemeType;
|
||||
public Color sliderColor = new Color(255, 255, 255, 255);
|
||||
public Color sliderBackgroundColor = new Color(255, 255, 255, 255);
|
||||
public Color sliderLabelColor = new Color(255, 255, 255, 255);
|
||||
public Color sliderPopupLabelColor = new Color(255, 255, 255, 255);
|
||||
public Color sliderHandleColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Switch
|
||||
public Color switchBorderColor = new Color(255, 255, 255, 255);
|
||||
public Color switchBackgroundColor = new Color(255, 255, 255, 255);
|
||||
public Color switchHandleOnColor = new Color(255, 255, 255, 255);
|
||||
public Color switchHandleOffColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Toggle
|
||||
public TMP_FontAsset toggleFont;
|
||||
public ToggleThemeType toggleThemeType;
|
||||
public Color toggleTextColor = new Color(255, 255, 255, 255);
|
||||
public Color toggleBorderColor = new Color(255, 255, 255, 255);
|
||||
public Color toggleBackgroundColor = new Color(255, 255, 255, 255);
|
||||
public Color toggleCheckColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Tooltip
|
||||
public TMP_FontAsset tooltipFont;
|
||||
public float tooltipFontSize = 22;
|
||||
public Color tooltipTextColor = new Color(255, 255, 255, 255);
|
||||
public Color tooltipBackgroundColor = new Color(255, 255, 255, 255);
|
||||
|
||||
// Custom Objects
|
||||
public TMP_FontAsset customObjPrimaryFont;
|
||||
public TMP_FontAsset customObjSecondaryFont;
|
||||
public Color customObjPrimaryColor = new Color(255, 255, 255, 255);
|
||||
public Color customObjSecondaryColor = new Color(255, 255, 255, 255);
|
||||
|
||||
public enum ModalWindowThemeType { Basic, Custom }
|
||||
public enum NotificationThemeType { Basic, Custom }
|
||||
public enum SliderThemeType { Basic, Custom }
|
||||
public enum ToggleThemeType { Basic, Custom }
|
||||
}
|
||||
}
|
||||
35
Assets/Modern UI Pack/Scripts/UI Manager/UIManager.cs.meta
Normal file
35
Assets/Modern UI Pack/Scripts/UI Manager/UIManager.cs.meta
Normal file
@@ -0,0 +1,35 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb7cf53b7c3b36a4b9f4d2b688942503
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- darkSkin: {fileID: 11400000, guid: 7ce3e20887f60d14d92e8672f8b0be93, type: 2}
|
||||
- lightSkin: {fileID: 11400000, guid: adcacdc617b648947a8ef38e1e52f321, type: 2}
|
||||
- UIMLogoDark: {fileID: 2800000, guid: 7c235d0fbe0f2464cabb3ebb1f7fb5e7, type: 3}
|
||||
- UIMLogoLight: {fileID: 2800000, guid: 211e0fc65fd3ff147b04f622187dd2d3, type: 3}
|
||||
- buttonFont: {instanceID: 0}
|
||||
- dropdownItemFont: {instanceID: 0}
|
||||
- dropdownFont: {instanceID: 0}
|
||||
- selectorFont: {instanceID: 0}
|
||||
- inputFieldFont: {instanceID: 0}
|
||||
- modalWindowTitleFont: {instanceID: 0}
|
||||
- modalWindowContentFont: {instanceID: 0}
|
||||
- notificationTitleFont: {instanceID: 0}
|
||||
- notificationDescriptionFont: {instanceID: 0}
|
||||
- progressBarLabelFont: {instanceID: 0}
|
||||
- sliderLabelFont: {instanceID: 0}
|
||||
- toggleFont: {instanceID: 0}
|
||||
- tooltipFont: {instanceID: 0}
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: f66c4aa44c09b6a42a2b5b9f9334d824, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManager.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,57 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerAnimatedIcon : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
public UIManager UIManagerAsset;
|
||||
|
||||
[Header("Resources")]
|
||||
public List<GameObject> images = new List<GameObject>();
|
||||
public List<GameObject> imagesWithAlpha = new List<GameObject>();
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateAnimatedIcon();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateAnimatedIcon(); }
|
||||
}
|
||||
|
||||
void UpdateAnimatedIcon()
|
||||
{
|
||||
for (int i = 0; i < images.Count; ++i)
|
||||
{
|
||||
if (images[i] == null)
|
||||
continue;
|
||||
|
||||
Image currentImage = images[i].GetComponent<Image>();
|
||||
currentImage.color = UIManagerAsset.animatedIconColor;
|
||||
}
|
||||
|
||||
for (int i = 0; i < imagesWithAlpha.Count; ++i)
|
||||
{
|
||||
if (imagesWithAlpha[i] == null)
|
||||
continue;
|
||||
|
||||
Image currentAlphaImage = imagesWithAlpha[i].GetComponent<Image>();
|
||||
currentAlphaImage.color = new Color(UIManagerAsset.animatedIconColor.r, UIManagerAsset.animatedIconColor.g, UIManagerAsset.animatedIconColor.b, currentAlphaImage.color.a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa9c8e8ebd8e36245bbac0e6d6979363
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 3ed3bfb48269e2646b4dc2130299c956, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerAnimatedIcon.cs
|
||||
uploadId: 628721
|
||||
105
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerButton.cs
Normal file
105
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerButton.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
[RequireComponent(typeof(ButtonManager))]
|
||||
public class UIManagerButton : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private bool outlineMode;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
public ButtonManager buttonManager;
|
||||
[HideInInspector] public bool overrideColors = false;
|
||||
[HideInInspector] public bool overrideFonts = false;
|
||||
|
||||
// Resources
|
||||
[HideInInspector] public Image disabledBackground;
|
||||
[HideInInspector] public Image normalBackground;
|
||||
[HideInInspector] public Image highlightedBackground;
|
||||
[HideInInspector] public Image disabledIcon;
|
||||
[HideInInspector] public Image normalIcon;
|
||||
[HideInInspector] public Image highlightedIcon;
|
||||
[HideInInspector] public TextMeshProUGUI disabledText;
|
||||
[HideInInspector] public TextMeshProUGUI normalText;
|
||||
[HideInInspector] public TextMeshProUGUI highlightedText;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
if (buttonManager == null) { buttonManager = GetComponent<ButtonManager>(); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateButton();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null || buttonManager == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateButton(); }
|
||||
}
|
||||
|
||||
void UpdateButton()
|
||||
{
|
||||
if (overrideColors == false)
|
||||
{
|
||||
if (disabledBackground != null) { disabledBackground.color = highlightedBackground.color = new Color(UIManagerAsset.buttonAccentColor.r, UIManagerAsset.buttonAccentColor.g, UIManagerAsset.buttonAccentColor.b, UIManagerAsset.buttonDisabledAlpha); }
|
||||
if (normalBackground != null) { normalBackground.color = UIManagerAsset.buttonAccentColor; }
|
||||
if (highlightedBackground != null) { highlightedBackground.color = UIManagerAsset.buttonAccentColor; }
|
||||
}
|
||||
|
||||
if (buttonManager.enableIcon == true && overrideColors == false)
|
||||
{
|
||||
if (outlineMode == false)
|
||||
{
|
||||
if (disabledIcon != null) { disabledIcon.color = UIManagerAsset.buttonNormalColor; }
|
||||
if (normalIcon != null) { normalIcon.color = UIManagerAsset.buttonNormalColor; }
|
||||
if (highlightedIcon != null) { highlightedIcon.color = UIManagerAsset.buttonNormalColor; }
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (disabledIcon != null) { disabledIcon.color = new Color(UIManagerAsset.buttonAccentColor.r, UIManagerAsset.buttonAccentColor.g, UIManagerAsset.buttonAccentColor.b, UIManagerAsset.buttonDisabledAlpha); }
|
||||
if (normalIcon != null) { normalIcon.color = UIManagerAsset.buttonAccentColor; }
|
||||
if (highlightedIcon != null) { highlightedIcon.color = UIManagerAsset.buttonNormalColor; }
|
||||
}
|
||||
}
|
||||
|
||||
if (buttonManager.enableText == true)
|
||||
{
|
||||
if (overrideColors == false)
|
||||
{
|
||||
if (outlineMode == false)
|
||||
{
|
||||
if (disabledText != null) { disabledText.color = UIManagerAsset.buttonNormalColor; }
|
||||
if (normalText != null) { normalText.color = UIManagerAsset.buttonNormalColor; }
|
||||
if (highlightedText != null) { highlightedText.color = UIManagerAsset.buttonNormalColor; }
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (disabledText != null) { disabledText.color = new Color(UIManagerAsset.buttonAccentColor.r, UIManagerAsset.buttonAccentColor.g, UIManagerAsset.buttonAccentColor.b, UIManagerAsset.buttonDisabledAlpha); }
|
||||
if (normalText != null) { normalText.color = UIManagerAsset.buttonAccentColor; }
|
||||
if (highlightedText != null) { highlightedText.color = UIManagerAsset.buttonNormalColor; }
|
||||
}
|
||||
}
|
||||
|
||||
if (overrideFonts == false)
|
||||
{
|
||||
if (disabledText != null) { disabledText.font = UIManagerAsset.buttonFont; }
|
||||
if (normalText != null) { normalText.font = UIManagerAsset.buttonFont; }
|
||||
if (highlightedText != null) { highlightedText.font = UIManagerAsset.buttonFont; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b01fef50de04046448865a6d70ddb9b7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 98d001ce6b3b53242911dcc3d1415f59, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerButton.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,46 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[CustomEditor(typeof(UIManagerButton))]
|
||||
public class UIManagerButtonEditor : Editor
|
||||
{
|
||||
private UIManagerButton uimTarget;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
uimTarget = (UIManagerButton)target;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
DrawDefaultInspector();
|
||||
EditorGUI.indentLevel++;
|
||||
|
||||
if (uimTarget.buttonManager == null) { return; }
|
||||
|
||||
uimTarget.disabledBackground = EditorGUILayout.ObjectField("Background Disabled", uimTarget.disabledBackground, typeof(Image), true) as Image;
|
||||
uimTarget.normalBackground = EditorGUILayout.ObjectField("Background Normal", uimTarget.normalBackground, typeof(Image), true) as Image;
|
||||
uimTarget.highlightedBackground = EditorGUILayout.ObjectField("Background Highlighted", uimTarget.highlightedBackground, typeof(Image), true) as Image;
|
||||
|
||||
if (uimTarget.buttonManager.enableIcon)
|
||||
{
|
||||
uimTarget.disabledIcon = EditorGUILayout.ObjectField("Icon Disabled", uimTarget.disabledIcon, typeof(Image), true) as Image;
|
||||
uimTarget.normalIcon = EditorGUILayout.ObjectField("Icon Normal", uimTarget.normalIcon, typeof(Image), true) as Image;
|
||||
uimTarget.highlightedIcon = EditorGUILayout.ObjectField("Icon Highlighted", uimTarget.highlightedIcon, typeof(Image), true) as Image;
|
||||
}
|
||||
|
||||
if (uimTarget.buttonManager.enableText)
|
||||
{
|
||||
uimTarget.disabledText = EditorGUILayout.ObjectField("Text Disabled", uimTarget.disabledText, typeof(TextMeshProUGUI), true) as TextMeshProUGUI;
|
||||
uimTarget.normalText = EditorGUILayout.ObjectField("Text Normal", uimTarget.normalText, typeof(TextMeshProUGUI), true) as TextMeshProUGUI;
|
||||
uimTarget.highlightedText = EditorGUILayout.ObjectField("Text Highlighted", uimTarget.highlightedText, typeof(TextMeshProUGUI), true) as TextMeshProUGUI;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 354b0fb6987f0064fa5b7adcc22921a3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 98d001ce6b3b53242911dcc3d1415f59, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerButtonEditor.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,39 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerContextMenu : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image backgroundImage;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateContextMenu();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateContextMenu(); }
|
||||
}
|
||||
|
||||
void UpdateContextMenu()
|
||||
{
|
||||
if (backgroundImage != null) { backgroundImage.color = UIManagerAsset.contextBackgroundColor; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c3b2c9406b3305e4494ef26f3f5fe26d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: cceded5b1d0834e48849fb152ac8e53d, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerContextMenu.cs
|
||||
uploadId: 628721
|
||||
110
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerCustom.cs
Normal file
110
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerCustom.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
[DisallowMultipleComponent]
|
||||
[AddComponentMenu("Modern UI Pack/UI Manager/UI Manager (Custom Object)")]
|
||||
public class UIManagerCustom : MonoBehaviour
|
||||
{
|
||||
[Header("Resources")]
|
||||
public UIManager UIManagerAsset;
|
||||
|
||||
[Header("Settings")]
|
||||
public ObjectType objectType;
|
||||
|
||||
[Header("Color")]
|
||||
public ColorType colorType = ColorType.Primary;
|
||||
public bool keepAlphaValue = false;
|
||||
public bool useCustomColor = false;
|
||||
|
||||
[Header("Font")]
|
||||
public FontType fontType = FontType.Primary;
|
||||
public bool useCustomFont = false;
|
||||
|
||||
Image imageObject;
|
||||
TextMeshProUGUI textObject;
|
||||
|
||||
public enum ObjectType
|
||||
{
|
||||
Text,
|
||||
Image
|
||||
}
|
||||
|
||||
public enum ColorType
|
||||
{
|
||||
Primary,
|
||||
Secondary
|
||||
}
|
||||
|
||||
public enum FontType
|
||||
{
|
||||
Primary,
|
||||
Secondary
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
if (!UIManagerAsset.enableDynamicUpdate) { UpdateElement(); this.enabled = false; }
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate) { UpdateElement(); }
|
||||
}
|
||||
|
||||
public void UpdateElement()
|
||||
{
|
||||
// Get objects
|
||||
if (objectType == ObjectType.Image && imageObject == null) { imageObject = gameObject.GetComponent<Image>(); }
|
||||
else if (objectType == ObjectType.Text && textObject == null) { textObject = gameObject.GetComponent<TextMeshProUGUI>(); }
|
||||
|
||||
// Check for image
|
||||
if (objectType == ObjectType.Image && imageObject != null)
|
||||
{
|
||||
if (!keepAlphaValue)
|
||||
{
|
||||
if (colorType == ColorType.Primary) { imageObject.color = UIManagerAsset.customObjPrimaryColor; }
|
||||
else if (colorType == ColorType.Secondary) { imageObject.color = UIManagerAsset.customObjSecondaryColor; }
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (colorType == ColorType.Primary) { imageObject.color = new Color(UIManagerAsset.customObjPrimaryColor.r, UIManagerAsset.customObjPrimaryColor.g, UIManagerAsset.customObjPrimaryColor.b, imageObject.color.a); }
|
||||
else if (colorType == ColorType.Secondary) { imageObject.color = new Color(UIManagerAsset.customObjSecondaryColor.r, UIManagerAsset.customObjSecondaryColor.g, UIManagerAsset.customObjSecondaryColor.b, imageObject.color.a); }
|
||||
}
|
||||
}
|
||||
|
||||
// Check for text
|
||||
else if (objectType == ObjectType.Text && textObject != null)
|
||||
{
|
||||
if (!useCustomColor)
|
||||
{
|
||||
if (!keepAlphaValue)
|
||||
{
|
||||
if (colorType == ColorType.Primary) { textObject.color = UIManagerAsset.customObjPrimaryColor; }
|
||||
else if (colorType == ColorType.Secondary) { textObject.color = UIManagerAsset.customObjSecondaryColor; }
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (colorType == ColorType.Primary) { textObject.color = new Color(UIManagerAsset.customObjPrimaryColor.r, UIManagerAsset.customObjPrimaryColor.g, UIManagerAsset.customObjPrimaryColor.b, textObject.color.a); }
|
||||
else if (colorType == ColorType.Secondary) { textObject.color = new Color(UIManagerAsset.customObjSecondaryColor.r, UIManagerAsset.customObjSecondaryColor.g, UIManagerAsset.customObjSecondaryColor.b, textObject.color.a); }
|
||||
}
|
||||
}
|
||||
|
||||
if (!useCustomFont)
|
||||
{
|
||||
if (fontType == FontType.Primary) { textObject.font = UIManagerAsset.customObjPrimaryFont; }
|
||||
else if (fontType == FontType.Secondary) { textObject.font = UIManagerAsset.customObjSecondaryFont; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 639cf8fed6ecf0041a4ef80ea9cd214d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: f66c4aa44c09b6a42a2b5b9f9334d824, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerCustom.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,53 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerDropdown : MonoBehaviour
|
||||
{
|
||||
[HideInInspector] public bool overrideColors = false;
|
||||
[HideInInspector] public bool overrideFonts = false;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private Image contentBackground;
|
||||
[SerializeField] private Image mainIcon;
|
||||
[SerializeField] private TextMeshProUGUI mainText;
|
||||
[SerializeField] private Image expandIcon;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateDropdown();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateDropdown(); }
|
||||
}
|
||||
|
||||
void UpdateDropdown()
|
||||
{
|
||||
if (overrideFonts == false && mainText != null) { mainText.font = UIManagerAsset.dropdownFont; }
|
||||
if (overrideColors == false)
|
||||
{
|
||||
if (background != null) { background.color = UIManagerAsset.dropdownBackgroundColor; }
|
||||
if (contentBackground != null) { contentBackground.color = UIManagerAsset.dropdownContentBackgroundColor; }
|
||||
if (mainIcon != null) { mainIcon.color = UIManagerAsset.dropdownPrimaryColor; }
|
||||
if (mainText != null) { mainText.color = UIManagerAsset.dropdownPrimaryColor; }
|
||||
if (expandIcon != null) { expandIcon.color = UIManagerAsset.dropdownPrimaryColor; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 025076e9ea2db4748aaecbfb47809745
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 0a39a4452fd810640afd1be6e700edee, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerDropdown.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,50 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerDropdownItem : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
public bool overrideColors = false;
|
||||
public bool overrideFonts = false;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image itemBackground;
|
||||
[SerializeField] private Image itemIcon;
|
||||
[SerializeField] private TextMeshProUGUI itemText;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateDropdown();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateDropdown(); }
|
||||
}
|
||||
|
||||
void UpdateDropdown()
|
||||
{
|
||||
if (overrideFonts == false && itemText != null) { itemText.font = UIManagerAsset.dropdownItemFont; }
|
||||
if (overrideColors == false)
|
||||
{
|
||||
if (itemBackground != null) { itemBackground.color = UIManagerAsset.dropdownItemBackgroundColor; }
|
||||
if (itemIcon != null) { itemIcon.color = UIManagerAsset.dropdownItemPrimaryColor; }
|
||||
if (itemText != null) { itemText.color = UIManagerAsset.dropdownItemPrimaryColor; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b5ddc5f89023bc448c7d4db08095515
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 0a39a4452fd810640afd1be6e700edee, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerDropdownItem.cs
|
||||
uploadId: 628721
|
||||
578
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerEditor.cs
Normal file
578
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerEditor.cs
Normal file
@@ -0,0 +1,578 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Presets;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[CustomEditor(typeof(UIManager))]
|
||||
[System.Serializable]
|
||||
public class UIManagerEditor : Editor
|
||||
{
|
||||
GUISkin customSkin;
|
||||
protected static string buildID = "B16-20241031";
|
||||
protected static float foldoutItemSpace = 2;
|
||||
protected static float foldoutTopSpace = 5;
|
||||
protected static float foldoutBottomSpace = 2;
|
||||
|
||||
protected static bool showAnimatedIcon = false;
|
||||
protected static bool showButton = false;
|
||||
protected static bool showContext = false;
|
||||
protected static bool showDropdown = false;
|
||||
protected static bool showHorSelector = false;
|
||||
protected static bool showInputField = false;
|
||||
protected static bool showModalWindow = false;
|
||||
protected static bool showNotification = false;
|
||||
protected static bool showProgressBar = false;
|
||||
protected static bool showScrollbar = false;
|
||||
protected static bool showSlider = false;
|
||||
protected static bool showSwitch = false;
|
||||
protected static bool showToggle = false;
|
||||
protected static bool showTooltip = false;
|
||||
protected static bool showCustomObjects = false;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (EditorGUIUtility.isProSkin == true) { customSkin = MUIPEditorHandler.GetDarkEditor(customSkin); }
|
||||
else { customSkin = MUIPEditorHandler.GetLightEditor(customSkin); }
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (customSkin == null)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Editor variables are missing. You can manually fix this by deleting " +
|
||||
"Modern UI Pack > Resources folder and then re-import the package. \n\nIf you're still seeing this " +
|
||||
"dialog even after the re-import, contact me with this ID: " + buildID, MessageType.Error);
|
||||
|
||||
if (GUILayout.Button("Contact")) { Email(); }
|
||||
return;
|
||||
}
|
||||
|
||||
// Foldout style
|
||||
GUIStyle foldoutStyle = customSkin.FindStyle("UIM Foldout");
|
||||
|
||||
// UIM Header
|
||||
MUIPEditorHandler.DrawHeader(customSkin, "UIM Header", 8);
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
// Animated Icon
|
||||
var animatedIconColor = serializedObject.FindProperty("animatedIconColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showAnimatedIcon = EditorGUILayout.Foldout(showAnimatedIcon, "Animated Icon", true, foldoutStyle);
|
||||
showAnimatedIcon = GUILayout.Toggle(showAnimatedIcon, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showAnimatedIcon)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(animatedIconColor, customSkin, "Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
|
||||
#region Button
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var buttonFont = serializedObject.FindProperty("buttonFont");
|
||||
var buttonNormalColor = serializedObject.FindProperty("buttonNormalColor");
|
||||
var buttonAccentColor = serializedObject.FindProperty("buttonAccentColor");
|
||||
var buttonDisabledAlpha = serializedObject.FindProperty("buttonDisabledAlpha");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showButton = EditorGUILayout.Foldout(showButton, "Button", true, foldoutStyle);
|
||||
showButton = GUILayout.Toggle(showButton, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showButton)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(buttonFont, customSkin, "Font");
|
||||
MUIPEditorHandler.DrawProperty(buttonNormalColor, customSkin, "Normal Color");
|
||||
MUIPEditorHandler.DrawProperty(buttonAccentColor, customSkin, "Accent Color");
|
||||
MUIPEditorHandler.DrawProperty(buttonDisabledAlpha, customSkin, "Disabled Alpha");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Context Menu
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var contextBackgroundColor = serializedObject.FindProperty("contextBackgroundColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showContext = EditorGUILayout.Foldout(showContext, "Context Menu", true, foldoutStyle);
|
||||
showContext = GUILayout.Toggle(showContext, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showContext)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(contextBackgroundColor, customSkin, "Background Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Dropdown
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var dropdownFont = serializedObject.FindProperty("dropdownFont");
|
||||
var dropdownItemFont = serializedObject.FindProperty("dropdownItemFont");
|
||||
var dropdownPrimaryColor = serializedObject.FindProperty("dropdownPrimaryColor");
|
||||
var dropdownBackgroundColor = serializedObject.FindProperty("dropdownBackgroundColor");
|
||||
var dropdownItemBackgroundColor = serializedObject.FindProperty("dropdownItemBackgroundColor");
|
||||
var dropdownItemPrimaryColor = serializedObject.FindProperty("dropdownItemPrimaryColor");
|
||||
var dropdownContentBackgroundColor = serializedObject.FindProperty("dropdownContentBackgroundColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showDropdown = EditorGUILayout.Foldout(showDropdown, "Dropdown", true, foldoutStyle);
|
||||
showDropdown = GUILayout.Toggle(showDropdown, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showDropdown)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(dropdownFont, customSkin, "Font");
|
||||
MUIPEditorHandler.DrawProperty(dropdownItemFont, customSkin, "Item Font");
|
||||
MUIPEditorHandler.DrawProperty(dropdownPrimaryColor, customSkin, "Primary");
|
||||
MUIPEditorHandler.DrawProperty(dropdownBackgroundColor, customSkin, "Background");
|
||||
MUIPEditorHandler.DrawProperty(dropdownContentBackgroundColor, customSkin, "Content Background");
|
||||
MUIPEditorHandler.DrawProperty(dropdownItemBackgroundColor, customSkin, "Item Background");
|
||||
MUIPEditorHandler.DrawProperty(dropdownItemPrimaryColor, customSkin, "Item Primary");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Horizontal Selector
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var selectorFont = serializedObject.FindProperty("selectorFont");
|
||||
var selectorColor = serializedObject.FindProperty("selectorColor");
|
||||
var selectorHighlightedColor = serializedObject.FindProperty("selectorHighlightedColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showHorSelector = EditorGUILayout.Foldout(showHorSelector, "Horizontal Selector", true, foldoutStyle);
|
||||
showHorSelector = GUILayout.Toggle(showHorSelector, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showHorSelector)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(selectorFont, customSkin, "Font");
|
||||
MUIPEditorHandler.DrawProperty(selectorColor, customSkin, "Color");
|
||||
MUIPEditorHandler.DrawProperty(selectorHighlightedColor, customSkin, "Highlighted Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Input Field
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var inputFieldFont = serializedObject.FindProperty("inputFieldFont");
|
||||
var inputFieldColor = serializedObject.FindProperty("inputFieldColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showInputField = EditorGUILayout.Foldout(showInputField, "Input Field", true, foldoutStyle);
|
||||
showInputField = GUILayout.Toggle(showInputField, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showInputField)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(inputFieldFont, customSkin, "Font");
|
||||
MUIPEditorHandler.DrawProperty(inputFieldColor, customSkin, "Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Modal Window
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var modalWindowTitleFont = serializedObject.FindProperty("modalWindowTitleFont");
|
||||
var modalWindowContentFont = serializedObject.FindProperty("modalWindowContentFont");
|
||||
var modalWindowTitleColor = serializedObject.FindProperty("modalWindowTitleColor");
|
||||
var modalWindowDescriptionColor = serializedObject.FindProperty("modalWindowDescriptionColor");
|
||||
var modalWindowIconColor = serializedObject.FindProperty("modalWindowIconColor");
|
||||
var modalWindowBackgroundColor = serializedObject.FindProperty("modalWindowBackgroundColor");
|
||||
var modalWindowContentPanelColor = serializedObject.FindProperty("modalWindowContentPanelColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showModalWindow = EditorGUILayout.Foldout(showModalWindow, "Modal Window", true, foldoutStyle);
|
||||
showModalWindow = GUILayout.Toggle(showModalWindow, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showModalWindow)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(modalWindowTitleFont, customSkin, "Title Font");
|
||||
MUIPEditorHandler.DrawProperty(modalWindowContentFont, customSkin, "Content Font");
|
||||
MUIPEditorHandler.DrawProperty(modalWindowTitleColor, customSkin, "Title Color");
|
||||
MUIPEditorHandler.DrawProperty(modalWindowDescriptionColor, customSkin, "Description Color");
|
||||
MUIPEditorHandler.DrawProperty(modalWindowIconColor, customSkin, "Icon Color");
|
||||
MUIPEditorHandler.DrawProperty(modalWindowBackgroundColor, customSkin, "Background Color");
|
||||
MUIPEditorHandler.DrawProperty(modalWindowContentPanelColor, customSkin, "Content Panel Color");
|
||||
EditorGUILayout.HelpBox("These values will only affect 'Style 1 - Standard' window.", MessageType.Info);
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Notification
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var notificationTitleFont = serializedObject.FindProperty("notificationTitleFont");
|
||||
var notificationTitleFontSize = serializedObject.FindProperty("notificationTitleFontSize");
|
||||
var notificationDescriptionFont = serializedObject.FindProperty("notificationDescriptionFont");
|
||||
var notificationDescriptionFontSize = serializedObject.FindProperty("notificationDescriptionFontSize");
|
||||
var notificationBackgroundColor = serializedObject.FindProperty("notificationBackgroundColor");
|
||||
var notificationTitleColor = serializedObject.FindProperty("notificationTitleColor");
|
||||
var notificationDescriptionColor = serializedObject.FindProperty("notificationDescriptionColor");
|
||||
var notificationIconColor = serializedObject.FindProperty("notificationIconColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showNotification = EditorGUILayout.Foldout(showNotification, "Notification", true, foldoutStyle);
|
||||
showNotification = GUILayout.Toggle(showNotification, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showNotification)
|
||||
{
|
||||
GUILayout.BeginHorizontal(EditorStyles.helpBox);
|
||||
EditorGUILayout.LabelField(new GUIContent("Title Font"), customSkin.FindStyle("Text"), GUILayout.Width(120));
|
||||
EditorGUILayout.PropertyField(notificationTitleFontSize, new GUIContent(""), GUILayout.Width(40));
|
||||
EditorGUILayout.PropertyField(notificationTitleFont, new GUIContent(""));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.BeginHorizontal(EditorStyles.helpBox);
|
||||
EditorGUILayout.LabelField(new GUIContent("Description Font"), customSkin.FindStyle("Text"), GUILayout.Width(120));
|
||||
EditorGUILayout.PropertyField(notificationDescriptionFontSize, new GUIContent(""), GUILayout.Width(40));
|
||||
EditorGUILayout.PropertyField(notificationDescriptionFont, new GUIContent(""));
|
||||
GUILayout.EndHorizontal();
|
||||
MUIPEditorHandler.DrawProperty(notificationBackgroundColor, customSkin, "Background Color");
|
||||
MUIPEditorHandler.DrawProperty(notificationTitleColor, customSkin, "Title Color");
|
||||
MUIPEditorHandler.DrawProperty(notificationDescriptionColor, customSkin, "Description Color");
|
||||
MUIPEditorHandler.DrawProperty(notificationIconColor, customSkin, "Icon Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Progress Bar
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var progressBarLabelFont = serializedObject.FindProperty("progressBarLabelFont");
|
||||
var progressBarColor = serializedObject.FindProperty("progressBarColor");
|
||||
var progressBarBackgroundColor = serializedObject.FindProperty("progressBarBackgroundColor");
|
||||
var progressBarLoopBackgroundColor = serializedObject.FindProperty("progressBarLoopBackgroundColor");
|
||||
var progressBarLabelColor = serializedObject.FindProperty("progressBarLabelColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showProgressBar = EditorGUILayout.Foldout(showProgressBar, "Progress Bar", true, foldoutStyle);
|
||||
showProgressBar = GUILayout.Toggle(showProgressBar, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showProgressBar)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(progressBarLabelFont, customSkin, "Label Font");
|
||||
MUIPEditorHandler.DrawProperty(progressBarColor, customSkin, "Color");
|
||||
MUIPEditorHandler.DrawProperty(progressBarLabelColor, customSkin, "Label Color");
|
||||
MUIPEditorHandler.DrawProperty(progressBarBackgroundColor, customSkin, "Background Color");
|
||||
MUIPEditorHandler.DrawProperty(progressBarLoopBackgroundColor, customSkin, "Loop BG Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Scrollbar
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var scrollbarColor = serializedObject.FindProperty("scrollbarColor");
|
||||
var scrollbarBackgroundColor = serializedObject.FindProperty("scrollbarBackgroundColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showScrollbar = EditorGUILayout.Foldout(showScrollbar, "Scrollbar", true, foldoutStyle);
|
||||
showScrollbar = GUILayout.Toggle(showScrollbar, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showScrollbar)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(scrollbarColor, customSkin, "Bar Color");
|
||||
MUIPEditorHandler.DrawProperty(scrollbarBackgroundColor, customSkin, "Background Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Slider
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var sliderThemeType = serializedObject.FindProperty("sliderThemeType");
|
||||
var sliderLabelFont = serializedObject.FindProperty("sliderLabelFont");
|
||||
var sliderColor = serializedObject.FindProperty("sliderColor");
|
||||
var sliderLabelColor = serializedObject.FindProperty("sliderLabelColor");
|
||||
var sliderPopupLabelColor = serializedObject.FindProperty("sliderPopupLabelColor");
|
||||
var sliderHandleColor = serializedObject.FindProperty("sliderHandleColor");
|
||||
var sliderBackgroundColor = serializedObject.FindProperty("sliderBackgroundColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showSlider = EditorGUILayout.Foldout(showSlider, "Slider", true, foldoutStyle);
|
||||
showSlider = GUILayout.Toggle(showSlider, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showSlider && sliderThemeType.enumValueIndex == 0)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(sliderThemeType, customSkin, "Theme Type");
|
||||
MUIPEditorHandler.DrawProperty(sliderLabelFont, customSkin, "Label Font");
|
||||
MUIPEditorHandler.DrawProperty(sliderColor, customSkin, "Primary Color");
|
||||
MUIPEditorHandler.DrawProperty(sliderBackgroundColor, customSkin, "Secondary Color");
|
||||
MUIPEditorHandler.DrawProperty(sliderLabelColor, customSkin, "Label Popup Color");
|
||||
}
|
||||
|
||||
if (showSlider && sliderThemeType.enumValueIndex == 1)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(sliderThemeType, customSkin, "Theme Type");
|
||||
MUIPEditorHandler.DrawProperty(sliderLabelFont, customSkin, "Label Font");
|
||||
MUIPEditorHandler.DrawProperty(sliderColor, customSkin, "Color");
|
||||
MUIPEditorHandler.DrawProperty(sliderLabelColor, customSkin, "Label Color");
|
||||
MUIPEditorHandler.DrawProperty(sliderPopupLabelColor, customSkin, "Label Popup Color");
|
||||
MUIPEditorHandler.DrawProperty(sliderHandleColor, customSkin, "Handle Color");
|
||||
MUIPEditorHandler.DrawProperty(sliderBackgroundColor, customSkin, "Background Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Switch
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var switchBorderColor = serializedObject.FindProperty("switchBorderColor");
|
||||
var switchBackgroundColor = serializedObject.FindProperty("switchBackgroundColor");
|
||||
var switchHandleOnColor = serializedObject.FindProperty("switchHandleOnColor");
|
||||
var switchHandleOffColor = serializedObject.FindProperty("switchHandleOffColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showSwitch = EditorGUILayout.Foldout(showSwitch, "Switch", true, foldoutStyle);
|
||||
showSwitch = GUILayout.Toggle(showSwitch, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showSwitch)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(switchBorderColor, customSkin, "Border Color");
|
||||
MUIPEditorHandler.DrawProperty(switchBackgroundColor, customSkin, "Background Color");
|
||||
MUIPEditorHandler.DrawProperty(switchHandleOnColor, customSkin, "Handle On Color");
|
||||
MUIPEditorHandler.DrawProperty(switchHandleOffColor, customSkin, "Handle Off Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Toggle
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var toggleFont = serializedObject.FindProperty("toggleFont");
|
||||
var toggleTextColor = serializedObject.FindProperty("toggleTextColor");
|
||||
var toggleBorderColor = serializedObject.FindProperty("toggleBorderColor");
|
||||
var toggleBackgroundColor = serializedObject.FindProperty("toggleBackgroundColor");
|
||||
var toggleCheckColor = serializedObject.FindProperty("toggleCheckColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showToggle = EditorGUILayout.Foldout(showToggle, "Toggle", true, foldoutStyle);
|
||||
showToggle = GUILayout.Toggle(showToggle, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showToggle)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(toggleFont, customSkin, "Font");
|
||||
MUIPEditorHandler.DrawProperty(toggleTextColor, customSkin, "Text Color");
|
||||
MUIPEditorHandler.DrawProperty(toggleBorderColor, customSkin, "Border Color");
|
||||
MUIPEditorHandler.DrawProperty(toggleBackgroundColor, customSkin, "Background Color");
|
||||
MUIPEditorHandler.DrawProperty(toggleCheckColor, customSkin, "Check Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(foldoutItemSpace);
|
||||
#endregion
|
||||
|
||||
#region Tooltip
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var tooltipFont = serializedObject.FindProperty("tooltipFont");
|
||||
var tooltipFontSize = serializedObject.FindProperty("tooltipFontSize");
|
||||
var tooltipTextColor = serializedObject.FindProperty("tooltipTextColor");
|
||||
var tooltipBackgroundColor = serializedObject.FindProperty("tooltipBackgroundColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showTooltip = EditorGUILayout.Foldout(showTooltip, "Tooltip", true, foldoutStyle);
|
||||
showTooltip = GUILayout.Toggle(showTooltip, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showTooltip)
|
||||
{
|
||||
GUILayout.BeginHorizontal(EditorStyles.helpBox);
|
||||
EditorGUILayout.LabelField(new GUIContent("Font"), customSkin.FindStyle("Text"), GUILayout.Width(120));
|
||||
EditorGUILayout.PropertyField(tooltipFontSize, new GUIContent(""), GUILayout.Width(40));
|
||||
EditorGUILayout.PropertyField(tooltipFont, new GUIContent(""));
|
||||
GUILayout.EndHorizontal();
|
||||
MUIPEditorHandler.DrawProperty(tooltipTextColor, customSkin, "Text Color");
|
||||
MUIPEditorHandler.DrawProperty(tooltipBackgroundColor, customSkin, "Background Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
#endregion
|
||||
|
||||
#region Custom Objects
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
var customObjPrimaryFont = serializedObject.FindProperty("customObjPrimaryFont");
|
||||
var customObjSecondaryFont = serializedObject.FindProperty("customObjSecondaryFont");
|
||||
var customObjPrimaryColor = serializedObject.FindProperty("customObjPrimaryColor");
|
||||
var customObjSecondaryColor = serializedObject.FindProperty("customObjSecondaryColor");
|
||||
|
||||
GUILayout.Space(foldoutTopSpace);
|
||||
GUILayout.BeginHorizontal();
|
||||
showCustomObjects = EditorGUILayout.Foldout(showCustomObjects, "Custom Objects", true, foldoutStyle);
|
||||
showCustomObjects = GUILayout.Toggle(showCustomObjects, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(foldoutBottomSpace);
|
||||
|
||||
if (showCustomObjects)
|
||||
{
|
||||
MUIPEditorHandler.DrawProperty(customObjPrimaryFont, customSkin, "Primary Font");
|
||||
MUIPEditorHandler.DrawProperty(customObjSecondaryFont, customSkin, "Secondary Font");
|
||||
MUIPEditorHandler.DrawProperty(customObjPrimaryColor, customSkin, "Primary Color");
|
||||
MUIPEditorHandler.DrawProperty(customObjSecondaryColor, customSkin, "Secondary Color");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
#endregion
|
||||
|
||||
#region Settings
|
||||
MUIPEditorHandler.DrawHeader(customSkin, "Options Header", 14);
|
||||
|
||||
var enableDynamicUpdate = serializedObject.FindProperty("enableDynamicUpdate");
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
GUILayout.Space(-2);
|
||||
GUILayout.BeginHorizontal();
|
||||
enableDynamicUpdate.boolValue = GUILayout.Toggle(enableDynamicUpdate.boolValue, new GUIContent("Enable Dynamic Update"), customSkin.FindStyle("Toggle"));
|
||||
enableDynamicUpdate.boolValue = GUILayout.Toggle(enableDynamicUpdate.boolValue, new GUIContent(""), customSkin.FindStyle("Toggle Helper"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(4);
|
||||
|
||||
if (enableDynamicUpdate.boolValue == true)
|
||||
{
|
||||
EditorGUILayout.HelpBox("When this option is enabled, all objects connected to this manager will be dynamically updated synchronously. " +
|
||||
"Basically; consumes more resources, but allows dynamic changes at runtime/editor.", MessageType.Info);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
EditorGUILayout.HelpBox("When this option is disabled, all objects connected to this manager will be updated only once on awake. " +
|
||||
"Basically; has better performance, but it's static.", MessageType.Info);
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
||||
var editorHints = serializedObject.FindProperty("editorHints");
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
GUILayout.Space(-3);
|
||||
editorHints.boolValue = MUIPEditorHandler.DrawTogglePlain(editorHints.boolValue, customSkin, "UI Manager Hints");
|
||||
GUILayout.Space(3);
|
||||
|
||||
if (editorHints.boolValue == true)
|
||||
{
|
||||
EditorGUILayout.HelpBox("These values are universal and affect all objects containing 'UI Manager' component.", MessageType.Info);
|
||||
EditorGUILayout.HelpBox("If want to assign unique values, remove 'UI Manager' component from the object ", MessageType.Info);
|
||||
EditorGUILayout.HelpBox("You can press 'Control/Command + Shift + M' to open the manager quickly.", MessageType.Info);
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
#endregion
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
if (Application.isPlaying == false) { this.Repaint(); }
|
||||
|
||||
GUILayout.Space(12);
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
if (GUILayout.Button("Reset to defaults", customSkin.button))
|
||||
ResetToDefaults();
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
#region Support
|
||||
MUIPEditorHandler.DrawHeader(customSkin, "Support Header", 14);
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("Need help?", customSkin.FindStyle("Text"));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("Contact for support", customSkin.button)) { Email(); }
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(6);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.Label("ID: " + buildID);
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(6);
|
||||
#endregion
|
||||
}
|
||||
|
||||
void Email() { Application.OpenURL("https://www.michsky.com/contact/"); }
|
||||
|
||||
void ResetToDefaults()
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("Reset to defaults", "Are you sure you want to reset UI Manager values to default?", "Yes", "Cancel"))
|
||||
{
|
||||
try
|
||||
{
|
||||
Preset defaultPreset = Resources.Load<Preset>("UI Manager Presets/Default");
|
||||
defaultPreset.ApplyTo(Resources.Load("MUIP Manager"));
|
||||
Selection.activeObject = null;
|
||||
Debug.Log("<b>[UI Manager]</b> Resetting successful.");
|
||||
}
|
||||
|
||||
catch { Debug.LogWarning("<b>[UI Manager]</b> Resetting failed. Default preset seems to be missing"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4497d8be01876a94082c1f68d86dc323
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- uimLogo: {instanceID: 0}
|
||||
- darkSkin: {fileID: 11400000, guid: 7ce3e20887f60d14d92e8672f8b0be93, type: 2}
|
||||
- lightSkin: {fileID: 11400000, guid: adcacdc617b648947a8ef38e1e52f321, type: 2}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerEditor.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,70 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerHSelector : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
[HideInInspector] public bool overrideColors = false;
|
||||
[HideInInspector] public bool overrideFonts = false;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private List<GameObject> images = new List<GameObject>();
|
||||
[SerializeField] private List<GameObject> imagesHighlighted = new List<GameObject>();
|
||||
[SerializeField] private List<GameObject> texts = new List<GameObject>();
|
||||
|
||||
Color latestColor;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateSelector();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateSelector(); }
|
||||
}
|
||||
|
||||
void UpdateSelector()
|
||||
{
|
||||
if (overrideColors == false && latestColor != UIManagerAsset.selectorColor)
|
||||
{
|
||||
for (int i = 0; i < images.Count; ++i)
|
||||
{
|
||||
Image currentImage = images[i].GetComponent<Image>();
|
||||
currentImage.color = new Color(UIManagerAsset.selectorColor.r, UIManagerAsset.selectorColor.g, UIManagerAsset.selectorColor.b, currentImage.color.a);
|
||||
}
|
||||
|
||||
for (int i = 0; i < imagesHighlighted.Count; ++i)
|
||||
{
|
||||
Image currentAlphaImage = imagesHighlighted[i].GetComponent<Image>();
|
||||
currentAlphaImage.color = new Color(UIManagerAsset.selectorHighlightedColor.r, UIManagerAsset.selectorHighlightedColor.g, UIManagerAsset.selectorHighlightedColor.b, currentAlphaImage.color.a);
|
||||
}
|
||||
|
||||
latestColor = UIManagerAsset.selectorColor;
|
||||
}
|
||||
|
||||
for (int i = 0; i < texts.Count; ++i)
|
||||
{
|
||||
TextMeshProUGUI currentText = texts[i].GetComponent<TextMeshProUGUI>();
|
||||
|
||||
if (overrideColors == false) { currentText.color = new Color(UIManagerAsset.selectorColor.r, UIManagerAsset.selectorColor.g, UIManagerAsset.selectorColor.b, currentText.color.a); }
|
||||
if (overrideFonts == false) { currentText.font = UIManagerAsset.selectorFont; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e882cff0df1ed284a8cfdf670297b01d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 7a33180745301ca4b903e0c6e51cfeb6, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerHSelector.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,57 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerInputField : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
public bool overrideColors = false;
|
||||
public bool overrideFonts = false;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private TextMeshProUGUI mainText;
|
||||
[SerializeField] private TextMeshProUGUI placeholderText;
|
||||
[SerializeField] private Image filledImage;
|
||||
[SerializeField] private Image backgroundImage;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateInputField();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateInputField(); }
|
||||
}
|
||||
|
||||
void UpdateInputField()
|
||||
{
|
||||
if (overrideColors == false)
|
||||
{
|
||||
mainText.color = new Color(UIManagerAsset.inputFieldColor.r, UIManagerAsset.inputFieldColor.g, UIManagerAsset.inputFieldColor.b, mainText.color.a);
|
||||
placeholderText.color = new Color(UIManagerAsset.inputFieldColor.r, UIManagerAsset.inputFieldColor.g, UIManagerAsset.inputFieldColor.b, placeholderText.color.a);
|
||||
filledImage.color = new Color(UIManagerAsset.inputFieldColor.r, UIManagerAsset.inputFieldColor.g, UIManagerAsset.inputFieldColor.b, filledImage.color.a);
|
||||
backgroundImage.color = new Color(UIManagerAsset.inputFieldColor.r, UIManagerAsset.inputFieldColor.g, UIManagerAsset.inputFieldColor.b, backgroundImage.color.a);
|
||||
}
|
||||
|
||||
if (overrideFonts == false)
|
||||
{
|
||||
mainText.font = UIManagerAsset.inputFieldFont;
|
||||
placeholderText.font = UIManagerAsset.inputFieldFont;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d170bc6b162fcce46a456b2011fd50b4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: e956b4f7a85075c43a444a9f05cc765a, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerInputField.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,48 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerModalWindow : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private Image contentBackground;
|
||||
[SerializeField] private Image icon;
|
||||
[SerializeField] private TextMeshProUGUI title;
|
||||
[SerializeField] private TextMeshProUGUI description;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateModalWindow();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateModalWindow(); }
|
||||
}
|
||||
|
||||
void UpdateModalWindow()
|
||||
{
|
||||
if (background != null) { background.color = UIManagerAsset.modalWindowBackgroundColor; }
|
||||
if (contentBackground != null) { contentBackground.color = UIManagerAsset.modalWindowContentPanelColor; }
|
||||
if (icon != null) { icon.color = UIManagerAsset.modalWindowIconColor; }
|
||||
if (title != null) { title.color = UIManagerAsset.modalWindowTitleColor; title.font = UIManagerAsset.modalWindowTitleFont; }
|
||||
if (description != null) { description.color = UIManagerAsset.modalWindowDescriptionColor; description.font = UIManagerAsset.modalWindowContentFont; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e577c30e78b6a8d428d2d7bc77913d0b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 443b1643bec077e478f70a7a0fd1adcd, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerModalWindow.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,59 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerNotification : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
[HideInInspector] public bool overrideColors = false;
|
||||
[HideInInspector] public bool overrideFonts = false;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private Image icon;
|
||||
[SerializeField] private TextMeshProUGUI title;
|
||||
[SerializeField] private TextMeshProUGUI description;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateNotification();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateNotification(); }
|
||||
}
|
||||
|
||||
void UpdateNotification()
|
||||
{
|
||||
if (overrideColors == false)
|
||||
{
|
||||
background.color = UIManagerAsset.notificationBackgroundColor;
|
||||
icon.color = UIManagerAsset.notificationIconColor;
|
||||
title.color = UIManagerAsset.notificationTitleColor;
|
||||
description.color = UIManagerAsset.notificationDescriptionColor;
|
||||
}
|
||||
|
||||
if (overrideFonts == false)
|
||||
{
|
||||
title.font = UIManagerAsset.notificationTitleFont;
|
||||
title.fontSize = UIManagerAsset.notificationTitleFontSize;
|
||||
description.font = UIManagerAsset.notificationDescriptionFont;
|
||||
description.fontSize = UIManagerAsset.notificationDescriptionFontSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb3339e2f5f66dd42b96285c9d99c82f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: adf3c8361dd31e1448483775ea241c10, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerNotification.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
public class UIManagerPieChart : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b375103e3437031408a5c7d7c17d04a6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 3ae7671fb73a5df4ebec7a6b32ae8e8c, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerPieChart.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,57 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerProgressBar : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
[HideInInspector] public bool overrideColors = false;
|
||||
[HideInInspector] public bool overrideFonts = false;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image bar;
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private TextMeshProUGUI label;
|
||||
|
||||
bool dynamicUpdateEnabled;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateProgressBar();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateProgressBar(); }
|
||||
}
|
||||
|
||||
void UpdateProgressBar()
|
||||
{
|
||||
if (overrideColors == false)
|
||||
{
|
||||
bar.color = UIManagerAsset.progressBarColor;
|
||||
background.color = UIManagerAsset.progressBarBackgroundColor;
|
||||
label.color = UIManagerAsset.progressBarLabelColor;
|
||||
}
|
||||
|
||||
if (overrideFonts == false)
|
||||
{
|
||||
label.font = UIManagerAsset.progressBarLabelFont;
|
||||
label.fontSize = UIManagerAsset.progressBarLabelFontSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dea4139266751024f8662f14af08584d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: be8d03bb95afe0641976d654781e9e44, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerProgressBar.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,52 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerProgressBarLoop : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
public bool hasBackground;
|
||||
public bool useRegularBackground;
|
||||
public bool overrideColors = false;
|
||||
|
||||
[Header("Resources")]
|
||||
public Image bar;
|
||||
[HideInInspector] public Image background;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateProgressBar();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateProgressBar(); }
|
||||
}
|
||||
|
||||
void UpdateProgressBar()
|
||||
{
|
||||
if (overrideColors == false)
|
||||
{
|
||||
bar.color = UIManagerAsset.progressBarColor;
|
||||
|
||||
if (hasBackground == true)
|
||||
{
|
||||
if (useRegularBackground == true) { background.color = UIManagerAsset.progressBarBackgroundColor; }
|
||||
else { background.color = UIManagerAsset.progressBarLoopBackgroundColor; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be5fad699a120164d91f8b2f69924ad1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: be8d03bb95afe0641976d654781e9e44, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerProgressBarLoop.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,27 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[CustomEditor(typeof(UIManagerProgressBarLoop))]
|
||||
public class UIManagerProgressBarLoopEditor : Editor
|
||||
{
|
||||
override public void OnInspectorGUI()
|
||||
{
|
||||
DrawDefaultInspector();
|
||||
var UIManagerProgressBarLoop = target as UIManagerProgressBarLoop;
|
||||
|
||||
using (var group = new EditorGUILayout.FadeGroupScope(Convert.ToSingle(UIManagerProgressBarLoop.hasBackground == true)))
|
||||
{
|
||||
if (group.visible == true)
|
||||
{
|
||||
UIManagerProgressBarLoop.background = EditorGUILayout.ObjectField("Background", UIManagerProgressBarLoop.background, typeof(Image), true) as Image;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10f63550a22ba87428f516a14e52d5d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: be8d03bb95afe0641976d654781e9e44, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerProgressBarLoopEditor.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerScrollbar : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private Image bar;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateScrollbar();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateScrollbar(); }
|
||||
}
|
||||
|
||||
void UpdateScrollbar()
|
||||
{
|
||||
background.color = UIManagerAsset.scrollbarBackgroundColor;
|
||||
bar.color = UIManagerAsset.scrollbarColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e098a0a519700eb4094ec2c8b9d07b30
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: dcc0ed9263c0d524aabeb5f4bd75ecee, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerScrollbar.cs
|
||||
uploadId: 628721
|
||||
94
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerSlider.cs
Normal file
94
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerSlider.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerSlider : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
public bool hasLabel;
|
||||
public bool hasPopupLabel;
|
||||
[HideInInspector] public bool overrideColors = false;
|
||||
[HideInInspector] public bool overrideFonts = false;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private Image bar;
|
||||
[SerializeField] private Image handle;
|
||||
[HideInInspector] public TextMeshProUGUI label;
|
||||
[HideInInspector] public TextMeshProUGUI popupLabel;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateSlider();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateSlider(); }
|
||||
}
|
||||
|
||||
void UpdateSlider()
|
||||
{
|
||||
if (UIManagerAsset.sliderThemeType == UIManager.SliderThemeType.Basic)
|
||||
{
|
||||
if (overrideColors == false)
|
||||
{
|
||||
background.color = UIManagerAsset.sliderBackgroundColor;
|
||||
bar.color = UIManagerAsset.sliderColor;
|
||||
handle.color = UIManagerAsset.sliderColor;
|
||||
}
|
||||
|
||||
if (hasLabel == true)
|
||||
{
|
||||
if (overrideColors == false) { label.color = new Color(UIManagerAsset.sliderColor.r, UIManagerAsset.sliderColor.g, UIManagerAsset.sliderColor.b, label.color.a); }
|
||||
if (overrideFonts == false) { label.font = UIManagerAsset.sliderLabelFont; }
|
||||
}
|
||||
|
||||
if (hasPopupLabel == true)
|
||||
{
|
||||
if (overrideColors == false) { popupLabel.color = new Color(UIManagerAsset.sliderPopupLabelColor.r, UIManagerAsset.sliderPopupLabelColor.g, UIManagerAsset.sliderPopupLabelColor.b, popupLabel.color.a); }
|
||||
if (overrideFonts == false) { popupLabel.font = UIManagerAsset.sliderLabelFont; }
|
||||
}
|
||||
}
|
||||
|
||||
else if (UIManagerAsset.sliderThemeType == UIManager.SliderThemeType.Custom)
|
||||
{
|
||||
if (overrideColors == false)
|
||||
{
|
||||
background.color = UIManagerAsset.sliderBackgroundColor;
|
||||
bar.color = UIManagerAsset.sliderColor;
|
||||
handle.color = UIManagerAsset.sliderHandleColor;
|
||||
}
|
||||
|
||||
if (hasLabel == true)
|
||||
{
|
||||
if (overrideColors == false) { label.color = new Color(UIManagerAsset.sliderLabelColor.r, UIManagerAsset.sliderLabelColor.g, UIManagerAsset.sliderLabelColor.b, label.color.a); }
|
||||
if (overrideFonts == false)
|
||||
{
|
||||
label.font = UIManagerAsset.sliderLabelFont;
|
||||
label.font = UIManagerAsset.sliderLabelFont;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasPopupLabel == true)
|
||||
{
|
||||
if (overrideColors == false) { popupLabel.color = new Color(UIManagerAsset.sliderPopupLabelColor.r, UIManagerAsset.sliderPopupLabelColor.g, UIManagerAsset.sliderPopupLabelColor.b, popupLabel.color.a); }
|
||||
if (overrideFonts == false) { popupLabel.font = UIManagerAsset.sliderLabelFont; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae2d1475ff8202447b792ea5e136014d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: b5c20faaa6c0f514092673e609258886, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerSlider.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,31 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[CustomEditor(typeof(UIManagerSlider))]
|
||||
public class UIManagerSliderEditor : Editor
|
||||
{
|
||||
override public void OnInspectorGUI()
|
||||
{
|
||||
DrawDefaultInspector();
|
||||
var UIManagerSlider = target as UIManagerSlider;
|
||||
|
||||
using (var group = new EditorGUILayout.FadeGroupScope(Convert.ToSingle(UIManagerSlider.hasLabel == true)))
|
||||
{
|
||||
if (group.visible == true)
|
||||
UIManagerSlider.label = EditorGUILayout.ObjectField("Label", UIManagerSlider.label, typeof(TextMeshProUGUI), true) as TextMeshProUGUI;
|
||||
}
|
||||
|
||||
using (var group = new EditorGUILayout.FadeGroupScope(Convert.ToSingle(UIManagerSlider.hasPopupLabel == true)))
|
||||
{
|
||||
if (group.visible == true)
|
||||
UIManagerSlider.popupLabel = EditorGUILayout.ObjectField("Popup Label", UIManagerSlider.popupLabel, typeof(TextMeshProUGUI), true) as TextMeshProUGUI;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7266b31f788ed3d4a9ede644825322bd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: b5c20faaa6c0f514092673e609258886, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerSliderEditor.cs
|
||||
uploadId: 628721
|
||||
49
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerSwitch.cs
Normal file
49
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerSwitch.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerSwitch : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
[HideInInspector] public bool overrideColors = false;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image border;
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private Image handleOn;
|
||||
[SerializeField] private Image handleOff;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateSwitch();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateSwitch(); }
|
||||
}
|
||||
|
||||
void UpdateSwitch()
|
||||
{
|
||||
if (overrideColors == false)
|
||||
{
|
||||
border.color = new Color(UIManagerAsset.switchBorderColor.r, UIManagerAsset.switchBorderColor.g, UIManagerAsset.switchBorderColor.b, border.color.a);
|
||||
background.color = new Color(UIManagerAsset.switchBackgroundColor.r, UIManagerAsset.switchBackgroundColor.g, UIManagerAsset.switchBackgroundColor.b, background.color.a);
|
||||
handleOn.color = new Color(UIManagerAsset.switchHandleOnColor.r, UIManagerAsset.switchHandleOnColor.g, UIManagerAsset.switchHandleOnColor.b, handleOn.color.a);
|
||||
handleOff.color = new Color(UIManagerAsset.switchHandleOffColor.r, UIManagerAsset.switchHandleOffColor.g, UIManagerAsset.switchHandleOffColor.b, handleOff.color.a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7f637a1b5cac8548a4a1cf0615c2015
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 1de3e885959f3b84f9f25beca3a9503d, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerSwitch.cs
|
||||
uploadId: 628721
|
||||
58
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerToggle.cs
Normal file
58
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerToggle.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerToggle : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image border;
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private Image check;
|
||||
[SerializeField] private TextMeshProUGUI onLabel;
|
||||
[SerializeField] private TextMeshProUGUI offLabel;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (!UIManagerAsset.enableDynamicUpdate)
|
||||
{
|
||||
UpdateToggle();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate) { UpdateToggle(); }
|
||||
}
|
||||
|
||||
void UpdateToggle()
|
||||
{
|
||||
border.color = UIManagerAsset.toggleBorderColor;
|
||||
background.color = UIManagerAsset.toggleBackgroundColor;
|
||||
check.color = UIManagerAsset.toggleCheckColor;
|
||||
|
||||
if (onLabel != null)
|
||||
{
|
||||
onLabel.color = new Color(UIManagerAsset.toggleTextColor.r, UIManagerAsset.toggleTextColor.g, UIManagerAsset.toggleTextColor.b, onLabel.color.a);
|
||||
onLabel.font = UIManagerAsset.toggleFont;
|
||||
}
|
||||
|
||||
if (offLabel != null)
|
||||
{
|
||||
offLabel.color = new Color(UIManagerAsset.toggleTextColor.r, UIManagerAsset.toggleTextColor.g, UIManagerAsset.toggleTextColor.b, offLabel.color.a);
|
||||
offLabel.font = UIManagerAsset.toggleFont;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 033273b6ffafa814cbd95d1b39b157d1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: b0f85f7da5042c0448a526d5ecacbfa9, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerToggle.cs
|
||||
uploadId: 628721
|
||||
44
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerTooltip.cs
Normal file
44
Assets/Modern UI Pack/Scripts/UI Manager/UIManagerTooltip.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerTooltip : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private TextMeshProUGUI text;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateTooltip();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateTooltip(); }
|
||||
}
|
||||
|
||||
void UpdateTooltip()
|
||||
{
|
||||
background.color = UIManagerAsset.tooltipBackgroundColor;
|
||||
text.color = UIManagerAsset.tooltipTextColor;
|
||||
text.font = UIManagerAsset.tooltipFont;
|
||||
text.fontSize = UIManagerAsset.tooltipFontSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38efc2a00eadebc409b20491d68ef527
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 146ad7c4429fc764088d2a5139a2537d, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerTooltip.cs
|
||||
uploadId: 628721
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
public class UIManagerWindowManager : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fbdb002fd0b22464c9f511beb2639e0e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 6cf11c0849502024eaa15de7d842e9f4, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 201717
|
||||
packageName: Modern UI Pack
|
||||
packageVersion: 5.5.19
|
||||
assetPath: Assets/Modern UI Pack/Scripts/UI Manager/UIManagerWindowManager.cs
|
||||
uploadId: 628721
|
||||
Reference in New Issue
Block a user