예제 #1
0
        //其实也会有一种情况就是 不可点击,但是我不删除component,省再次注册。


        #region 移除

        public static void Remove(GameObject go)
        {
            GUIEventListener listener = go.GetComponent <GUIEventListener>();

            if (listener != null)
            {
                Destroy(listener);
            }
        }
예제 #2
0
        static public GUIEventListener Get(GameObject go)
        {
            GUIEventListener listener = go.GetComponent <GUIEventListener>();

            if (listener == null)
            {
                listener = go.AddComponent <GUIEventListener>();
            }
            return(listener);
        }
예제 #3
0
 public static void Remove(GameObject[] gos)
 {
     for (int i = 0; i < gos.Length; i++)
     {
         GUIEventListener listener = gos[i].GetComponent <GUIEventListener>();
         if (listener != null)
         {
             Destroy(listener);
         }
     }
 }
예제 #4
0
        static public GUIEventListener Get(GameObject go, int i, int j)
        {
            GUIEventListener listener = go.GetComponent <GUIEventListener>();

            if (listener == null)
            {
                listener = go.AddComponent <GUIEventListener>();
            }
            listener.index = i;
            listener.indey = j;
            return(listener);
        }