public static void SetTweenAlphaInfoByTweenGroup(GameObject go, int tweenGroup, float from, float to, float duration, float delay) { if (go == null) { return; } TweenAlpha tween = null; TweenAlpha[] components = go.GetComponents <TweenAlpha>(); if (components != null && components.Length > 1) { for (int i = 0; i < components.Length; i++) { if (components[i].tweenGroup == tweenGroup) { tween = components[i]; break; } } } else if (components != null && components.Length == 1) { tween = components[0]; } TweenUtil.SetTweenAlphaInfoDetail(go, tween, from, to, duration, delay); }
public static void SetTweenAlphaInfo(GameObject go, float from, float to, float duration, float delay) { if (go == null) { return; } TweenAlpha component = go.GetComponent <TweenAlpha>(); TweenUtil.SetTweenAlphaInfoDetail(go, component, from, to, duration, delay); }
public static void SetTweenPositionInfo(GameObject go, Vector3 from, Vector3 to, float duration, float delay) { if (go == null) { return; } TweenPosition component = go.GetComponent <TweenPosition>(); TweenUtil.SetTweenPositionInfoDetail(go, component, from, to, duration, delay); }
public static void ScaleUGUI(GameObject gameObject, Vector2 to, float time, int type, float delay = 0f, LuaFunction finishToDo = null, object para = null) { Vector3 from = Vector3.zero; Vector3 to2 = TweenUtil.GET_POS(to.x, to.y, 0f); if (gameObject && (RectTransform)gameObject.transform) { from = TweenUtil.GET_POS(((RectTransform)gameObject.transform).sizeDelta.x, ((RectTransform)gameObject.transform).sizeDelta.y, 0f); } if (finishToDo != null) { LeanTween.value(gameObject, delegate(Vector3 size) { if (gameObject && (RectTransform)gameObject.transform) { ((RectTransform)gameObject.transform).sizeDelta = TweenUtil.GET_POS(size.x, size.y); } }, from, to2, time).setDelay(delay).setOnComplete(delegate(object completePara) { if (finishToDo != null) { finishToDo.Call(new object[] { completePara }); } finishToDo.Dispose(); finishToDo = null; }).setOnCompleteParam(para).tweenType = (LeanTweenType)type; } else { LeanTween.value(gameObject, delegate(Vector3 size) { if (gameObject && (RectTransform)gameObject.transform) { ((RectTransform)gameObject.transform).sizeDelta = TweenUtil.GET_POS(size.x, size.y); } }, from, to2, time).setDelay(delay).tweenType = (LeanTweenType)type; } }