private void WallButtonClicked(UIGradient thisGradient) { if (OnWallButtonClicked != null) { OnWallButtonClicked(thisGradient); } }
static public int ModifyMesh(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (matchType(l, argc, 2, typeof(UnityEngine.UI.VertexHelper))) { UIGradient self = (UIGradient)checkSelf(l); UnityEngine.UI.VertexHelper a1; checkType(l, 2, out a1); self.ModifyMesh(a1); return(0); } else if (matchType(l, argc, 2, typeof(UnityEngine.Mesh))) { UIGradient self = (UIGradient)checkSelf(l); UnityEngine.Mesh a1; checkType(l, 2, out a1); self.ModifyMesh(a1); return(0); } return(error(l, "No matched override function to call")); } catch (Exception e) { return(error(l, e)); } }
static int ModifyMesh(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(UIGradient), typeof(UnityEngine.Mesh))) { UIGradient obj = (UIGradient)ToLua.ToObject(L, 1); UnityEngine.Mesh arg0 = (UnityEngine.Mesh)ToLua.ToObject(L, 2); obj.ModifyMesh(arg0); return(0); } else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(UIGradient), typeof(UnityEngine.UI.VertexHelper))) { UIGradient obj = (UIGradient)ToLua.ToObject(L, 1); UnityEngine.UI.VertexHelper arg0 = (UnityEngine.UI.VertexHelper)ToLua.ToObject(L, 2); obj.ModifyMesh(arg0); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: UIGradient.ModifyMesh")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void Awake() { skillCreationState = GameObject.Find("SkillCreationCanvas").GetComponent <SkillCreationState>(); backgroundImage = GetComponent <Image>(); backgroundGradient = GetComponent <UIGradient>(); text = transform.Find("Text").GetComponent <Text>(); }
public override void OnInspectorGUI() { UIGradient script = (UIGradient)target; script.colors[0] = EditorGUILayout.ColorField("Bot1", script.colors[0]); script.colors[3] = EditorGUILayout.ColorField("Bot2", script.colors[3]); script.colors[1] = EditorGUILayout.ColorField("Top1", script.colors[1]); script.colors[2] = EditorGUILayout.ColorField("Top2", script.colors[2]); }
private void Start() { _loadingText = GetComponentInChildren <TextMeshProUGUI>(); _loadingBtn = GetComponent <Button>(); _loadingColor = GetComponent <Image>(); gradient = GetComponent <UIGradient>(); originalColorkeys = gradient.EffectGradient.colorKeys; StartCoroutine(LoadingAnimation()); }
static public int constructor(IntPtr l) { try { UIGradient o; o = new UIGradient(); pushValue(l, o); return(1); } catch (Exception e) { return(error(l, e)); } }
/// <summary> /// 显示中间的模式 /// </summary> /// <returns></returns> private IEnumerator ShowCenterMode() { Transform center = _tranformList[CenterIndex]; for (int i = 0; i < _tranformList.Count; i++) { UIGradient uIGradient = _tranformList[i].GetComponent <UIGradient>(); UIGradient iconGradient = _tranformList[i].Find("Icon").GetComponent <UIGradient>(); TMPro.TMP_Text Name = _tranformList[i].Find("Name").GetComponent <TMPro.TMP_Text>(); TMPro.TMP_Text Info = _tranformList[i].Find("Info").GetComponent <TMPro.TMP_Text>(); UIButtonOrdin Button = _tranformList[i].Find("ConfirmBtn").GetComponent <UIButtonOrdin>(); if (i != CenterIndex) { Tweens.Add(_tranformList[i].DOScale(1, 1f)); Tweens.Add(DOTween.To(() => uIGradient.color1, x => uIGradient.color1 = x, new Color(1, 1, 1, 0.5f), 0.3f)); Tweens.Add(DOTween.To(() => uIGradient.color2, x => uIGradient.color2 = x, new Color(1, 1, 1, 0.5f), 0.3f)); Tweens.Add(DOTween.To(() => iconGradient.color1, x => iconGradient.color1 = x, ColorHelper.GradientBlue, 1f)); Tweens.Add(DOTween.To(() => iconGradient.color2, x => iconGradient.color2 = x, ColorHelper.GradientGreen, 1f)); Tweens.Add(Name.DOColor(ColorHelper.Black, 0.3f)); Tweens.Add(Info.DOColor(ColorHelper.Black, 0.3f)); Tweens.Add(Button.transform.DOScale(0f, 0.3f)); Tweens.Add(Info.transform.DOLocalMoveY(-150, 0.3f)); } else { Tweens.Add(Name.DOColor(Color.white, 0.3f)); Tweens.Add(Info.DOColor(Color.white, 0.3f)); Tweens.Add(DOTween.To(() => iconGradient.color1, x => iconGradient.color1 = x, Color.white, 0.3f)); Tweens.Add(DOTween.To(() => iconGradient.color2, x => iconGradient.color2 = x, Color.white, 0.3f)); Tweens.Add(DOTween.To(() => uIGradient.color2, x => uIGradient.color2 = x, new Color(102 / 255f, 216 / 255f, 181 / 255f), 1f)); Tweens.Add(DOTween.To(() => uIGradient.color1, x => uIGradient.color1 = x, new Color(87 / 255f, 173 / 255f, 234 / 255f), 1f)); _tranformList[i].SetAsLastSibling(); } } Tweens.Add(center.DOScale(1.5f, 0.5f)); yield return(new WaitForSeconds(0.5f)); Tweens.Add(center.DOScale(1.3334f, 0.5f)); yield return(new WaitForSeconds(0.5f)); Tweens.Add(_tranformList[CenterIndex].Find("Info").transform.DOLocalMoveY(-220, 0.3f)); yield return(new WaitForSeconds(0.3f)); Tweens.Add(_tranformList[CenterIndex].Find("ConfirmBtn").DOScale(1.2f, 0.3f)); yield return(new WaitForSeconds(0.3f)); Tweens.Add(_tranformList[CenterIndex].Find("ConfirmBtn").DOScale(1f, 0.2f)); }
static int get_bottomColor(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIGradient obj = (UIGradient)o; UnityEngine.Color32 ret = obj.bottomColor; ToLua.PushValue(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index bottomColor on a nil value" : e.Message)); } }
static int set_bottomColor(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIGradient obj = (UIGradient)o; UnityEngine.Color32 arg0 = (UnityEngine.Color32)ToLua.CheckObject(L, 2, typeof(UnityEngine.Color32)); obj.bottomColor = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index bottomColor on a nil value" : e.Message)); } }
//public void SetWorldColor(Button clickedButton) //{ // width = Screen.width; // height = Screen.height; // Vector2 buttonPos = RectTransformUtility.WorldToScreenPoint(null, clickedButton.transform.position); // Vector2 buttonPosNormalized = new Vector2(buttonPos.x / width, buttonPos.y / height); // worldFillMaterial.SetVector("_Offset", new Vector4(-buttonPosNormalized.x, -buttonPosNormalized.y, 0, 1)); // if (currentCoroutine == null) // { // this.newColor = clickedButton.GetComponent<Image>().color; // worldFillMaterial.SetColor("_FrontColor", newColor); // finalValue = Screen.orientation == ScreenOrientation.Landscape ? Mathf.Sqrt(Mathf.Pow((float)width / height, 2) + 1) // : Mathf.Sqrt(Mathf.Pow((float)height / width, 2) + 1); // StopCoroutine("SetMaterialParams"); // currentCoroutine = StartCoroutine(SetMaterialParams(finalValue)); // } // //valueTweener = DOTween.To(x => radius = x, 0, finalValue, easeDuration) // // .SetEase(easeType) // // .SetAutoKill(false); // //valueTweener.OnUpdate(() => Debug.Log(radius));// worldFillMaterial.SetFloat("_Radius", radius)); //} public void SetWorldColor(UIGradient gradient) { width = Screen.width; height = Screen.height; Vector2 buttonPos = RectTransformUtility.WorldToScreenPoint(null, gradient.transform.position); Vector2 buttonPosNormalized = new Vector2(buttonPos.x / width, buttonPos.y / height); foreach (Material worldFillMaterial in worldFillMaterials) { worldFillMaterial.SetVector("_Offset", new Vector4(-buttonPosNormalized.x, -buttonPosNormalized.y, 0, 1)); worldFillMaterial.SetFloat("_Radius", 0); this.newColor = gradient._effectGradient.colorKeys[0].color; worldFillMaterial.SetColor("_FrontColor", newColor); finalValue = Screen.orientation == ScreenOrientation.Landscape ? Mathf.Sqrt(Mathf.Pow((float)width / height, 2) + 1) : Mathf.Sqrt(Mathf.Pow((float)height / width, 2) + 1); worldFillMaterial.DOFloat(finalValue, "_Radius", easeDuration).SetEase(easeType).OnComplete(() => worldFillMaterial.SetColor("_BackColor", newColor)); } }
private void Start() { thisButton = GetComponent <Button>(); thisGradient = GetComponentInChildren <UIGradient>(); thisButton.onClick.AddListener(() => WallButtonClicked(thisGradient)); }
void Start() { gradient = GetComponent <UIGradient> (); image = GetComponent <Image> (); }
private void Start() { m_uiGradient = gameObject.GetComponent <UIGradient>(); }