public static void PlayTweenScaleReverse(GameObject go) { TweenScale ts = MonoExtendUtil.GetOrAddComponent <TweenScale>(go); ts.enabled = true; ts.PlayReverse(); }
/// <summary> /// 停止牌桌倒计时 /// </summary> /// <param name="go">Go.</param> /// <param name="str">String.</param> public static void StopLabelCount(GameObject go, string str) { LabelCount lc = MonoExtendUtil.GetOrAddComponent <LabelCount>(go); lc.label.text = str; lc.enabled = false; }
public static void ChangeTextureName(GameObject go, string name) { UITexture ut = MonoExtendUtil.GetOrAddComponent <UITexture>(go); Debugger.Log(name); Debugger.Log(ut.mainTexture); // ut.name= name; }
public static void PlayTweenScale(GameObject go) { TweenScale tp = MonoExtendUtil.GetOrAddComponent <TweenScale>(go); tp.ResetToBeginning(); tp.enabled = true; tp.Play(); }
/// <summary> /// 牌桌倒计时 /// </summary> /// <param name="go">Go.</param> /// <param name="start">开始Date.</param> /// <param name="stop">结束Date.</param> /// <param name="speed">间隔速度.</param> public static void SetCountLabelTime(GameObject go, int start, int stop, int speed) { LabelCount lc = MonoExtendUtil.GetOrAddComponent <LabelCount>(go); lc.enabled = false; lc.startTime = start; lc.stopTime = stop; lc.speed = speed; lc.enabled = true; }
public static void SetUILabelTextLength(GameObject go, string text, int value) { if (go == null) { return; } UILabel uiLable = MonoExtendUtil.GetOrAddComponent <UILabel>(go); uiLable.text = text.PadLeft(value, '0'); }
public static void SetUILabelText(GameObject go, string text) { if (go == null) { return; } UILabel uiLable = MonoExtendUtil.GetOrAddComponent <UILabel>(go); uiLable.text = text; }
/// <summary> /// 更改UISprite图片名称 /// </summary> /// <param name="go">Go.</param> public static void ChangeSpriteName(GameObject go, string name) { UISprite us = MonoExtendUtil.GetOrAddComponent <UISprite>(go); us.spriteName = name; UIButton bt = go.GetComponent <UIButton>(); if (bt != null) { bt.normalSprite = name; } }
public static void PlayTweenScale(GameObject go, Vector3 vFrom, Vector3 vTo, float time1, float time2) { TweenScale ts = MonoExtendUtil.GetOrAddComponent <TweenScale>(go); ts.from = vFrom; ts.to = vTo; ts.duration = time1; ts.delay = time2; ts.style = UITweener.Style.Once; ts.enabled = true; ts.PlayForward(); }
public static void PlayTweenPosition(GameObject go, Vector3 vFrom, Vector3 vTo, float time, LuaFunction luafun) { TweenPosition tp = MonoExtendUtil.GetOrAddComponent <TweenPosition>(go); tp.from = vFrom; tp.to = vTo; tp.duration = time; tp.ResetToBeginning(); tp.style = UITweener.Style.Once; tp.enabled = true; EventDelegate callBack = new EventDelegate(delegate { if (luafun != null) { luafun.Call(); } }); callBack.oneShot = true; tp.onFinished.Add(callBack); tp.PlayForward(); }
/// <summary> /// 获取当前物体层次 /// </summary> /// <returns>The depth.</returns> /// <param name="go">Go.</param> public static int GetDepth(GameObject go) { UISprite us = MonoExtendUtil.GetOrAddComponent <UISprite>(go); return(us.depth); }
public static void SnapSprite(GameObject go) { UISprite us = MonoExtendUtil.GetOrAddComponent <UISprite>(go); us.MakePixelPerfect(); }
/// <summary> /// 刷新UIgrid内节点的位置 /// </summary> /// <returns><c>true</c>, if grid was updated, <c>false</c> otherwise.</returns> /// <param name="go">Go.</param> public static void UpdateGrid(GameObject go) { UIGrid ug = MonoExtendUtil.GetOrAddComponent <UIGrid>(go); ug.Reposition(); }
/// <summary> /// 设置图片进度条显示进度. /// </summary> /// <param name="f">F.</param> public static void SetSpriteFillAmount(GameObject go, float f) { UISprite sp = MonoExtendUtil.GetOrAddComponent <UISprite>(go); sp.fillAmount = f; }
/// <summary> /// 设置图片层次 /// </summary> /// <param name="go">Go.</param> /// <param name="depth">Depth.</param> public static void SetDepth(GameObject go, int depth) { UISprite us = MonoExtendUtil.GetOrAddComponent <UISprite>(go); us.depth = depth; }
/// <summary> /// 刷新UItable内节点的位置 /// </summary> /// <returns><c>true</c>, if table was updated, <c>false</c> otherwise.</returns> /// <param name="go">Go.</param> public static void UpdateTable(GameObject go) { UITable ug = MonoExtendUtil.GetOrAddComponent <UITable>(go); ug.Reposition(); }
private void StartLooper() { looper = MonoExtendUtil.GetOrAddComponent <LuaLooper>(gameObject); looper.luaState = LuaState; }