void Start() { //player = GameObject.Find("Player").GetComponent<Player>(); buttonMgr = GameObject.Find("buttonMgr").GetComponent <ButtonMgr>(); //spriteRenderer = GetComponent<SpriteRenderer>(); prevVel = transform.position; }
/// <summary> /// 关闭高光 /// </summary> /// <param name="go"></param> public static GameObject OffUIHightligher(this GameObject go, bool deleteHighLighter = false) { ButtonMgr listener = go.GetComponent <ButtonMgr>(); if (listener == null) { listener = go.AddComponent <ButtonMgr>(); } listener.OffHight(); return(go); }
//private static void OnAssembleStart_OneToManyFunction(GameObject go) //{ // assembleAcceptBase_OneToOne.gameObject.OffHightligher(true); // assembleContainerBase_OneToOne.gameObject.OnHightligher(); // assembleAcceptBase_OneToOne.gameObject.OnMouseUp(OnAssembleEndFunction); //} //private static void OnAssembleEndFunction(GameObject go) //{ // assembleContainerBase_OneToOne.gameObject.OffHightligher(true); // assembleContainerBase_OneToOne.gameObject.OffMouseDown(OnAssembleStartFunction); // assembleContainerBase_OneToOne.gameObject.OffMouseUp(OnAssembleEndFunction); // assembleContainerBase_OneToOne = null; // assembleContainerBase_OneToOne = null; //} #endregion #region 高亮 public static GameObject OnUIHightligher(this GameObject go, bool useRecord = false) { ButtonMgr listener = go.GetComponent <ButtonMgr>(); if (listener == null) { listener = go.AddComponent <ButtonMgr>(); } listener.OnHight(useRecord); return(go); }
public static void SetUIClick(this GameObject go, ButtonMgr.VoidDelegate function) { ButtonMgr listener = go.GetComponent <ButtonMgr>(); if (listener == null) { listener = go.AddComponent <ButtonMgr>(); } listener.onClickLeft = function; }
// Use this for initialization void Start() { buttonMgr = GameObject.Find("buttonMgr").GetComponent <ButtonMgr>(); controller = GameObject.Find("Controller").GetComponent <Controller>(); }