new public void RemoveItem(CButtonToggle tog) { tweenState.Remove(tog); tweenTargetPos.Remove(tog); EventUtil.RemoveHover(tog.gameObject, OnTogHover); base.RemoveItem(tog); }
public void ResetState(CButtonToggle tog) { if (side == TabBarTweenSide.LEFT || side == TabBarTweenSide.RIGHT) { if ((int)tog.transform.localPosition.x != tweenTargetPos[tog]) { iTween.MoveTo(tog.gameObject, iTween.Hash("x", tweenTargetPos[tog], "time", 0.2f, "islocal", true, "easeType", iTween.EaseType.easeInOutCirc, "oncompletetarget", this, "oncomplete", "ResetState", "oncompleteparams", new object[] { tog })); } else { tweenState[tog] = false; } } else { if ((int)tog.transform.localPosition.y != tweenTargetPos[tog]) { iTween.MoveTo(tog.gameObject, iTween.Hash("y", tweenTargetPos[tog], "time", 0.2f, "islocal", true, "easeType", iTween.EaseType.easeInOutCirc, "oncompletetarget", this, "oncomplete", "ResetState", "oncompleteparams", new object[] { tog })); } else { tweenState[tog] = false; } } }
new public void AddItem(CButtonToggle tog) { base.AddItem(tog); tweenState[tog] = false; tweenTargetPos[tog] = 0; if (moveOnOver) { EventUtil.AddHover(tog.gameObject, OnTogHover, tog.gameObject); } }
public static CButtonToggle CreateTabBarBtn(int x, int y, Transform parent, string name, int w, int h, int depth) { GameObject obj = UnityEngine.Object.Instantiate(FuncUtil.GetUIAssetByPath(TAB_BUTTON_PATH)) as GameObject; if (obj == null) { return(null); } obj.transform.parent = parent; obj.transform.localScale = Vector3.one; obj.transform.localPosition = new Vector3(x, y, 0); CButtonToggle box = obj.GetComponent <CButtonToggle>(); box.width = w; box.height = h; box.Text = name; return(box); }