示例#1
0
 void Start()
 {
     //player = GameObject.Find("Player").GetComponent<Player>();
     buttonMgr = GameObject.Find("buttonMgr").GetComponent <ButtonMgr>();
     //spriteRenderer = GetComponent<SpriteRenderer>();
     prevVel = transform.position;
 }
示例#2
0
    /// <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);
    }
示例#3
0
    //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);
    }
示例#4
0
    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;
    }
示例#5
0
 // Use this for initialization
 void Start()
 {
     buttonMgr  = GameObject.Find("buttonMgr").GetComponent <ButtonMgr>();
     controller = GameObject.Find("Controller").GetComponent <Controller>();
 }