有时候Button点下去不是要求立即反应的,而是先有个特别短的动画,再反应. 实现: 继承Button,然后重写一下OnPointerClick,利用协程来延迟. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; using UnityEngine.EventSystems; using UnityEngine.UI; public cl…
用unity 实现调色板功能. 直接上代码: using UnityEngine; using System.Collections; using UnityEngine.UI; public class ColorPick : MonoBehaviour { public Image Saturation; public Image Hue; public Image Paint; public RectTransform Point_Stauration; public RectTransf…
1.把下面脚本放到Editor文件夹下,这样脚本继承Button之后,新声明的public变量才能在Inspector面板显示出来. using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEditor.UI; using UnityEngine; [CustomEditor(typeof(MyButton), true)] [CanEditMultipleObjects]…