Exemple #1
0
    public static List <UINode> a()
    {
        string[] array = new string[]
        {
            global::x.d,
            global::x.e,
            global::x.f
        };
        string[] array2 = new string[]
        {
            global::x.p,
            global::x.q,
            global::x.r
        };
        HashSet <int> hashSet = new HashSet <int>();
        List <UINode> list    = new List <UINode>();
        Rectangle     rect    = new Rectangle();

        for (int i = 0; i < array.Length; i++)
        {
            Type type = Type.GetType(array[i]);
            if (type == null)
            {
                type = Type.GetType(array2[i]);
            }
            if (type != null)
            {
                Component[] array3 = UnityEngine.Object.FindObjectsOfType(type) as Component[];
                Component[] array4 = array3;
                for (int j = 0; j < array4.Length; j++)
                {
                    Component  component  = array4[j];
                    GameObject gameObject = component.gameObject;
                    global::u.d("Find GameObject " + gameObject.name);
                    if (!hashSet.Contains(gameObject.GetInstanceID()) && global::x.a(gameObject, ref rect))
                    {
                        Rectangle bound = CoordinateTool.ConvertUnity2Mobile(rect);
                        UINode    item  = new UINode(gameObject, bound);
                        hashSet.Add(gameObject.GetInstanceID());
                        list.Add(item);
                    }
                }
            }
        }
        return(list);
    }
Exemple #2
0
 protected void d()
 {
     try
     {
         Cmd     a_      = Cmd.TOUCH_NOTIFY;
         j       j       = new j(a_, this.n);
         Touch[] touches = Input.touches;
         int     num     = touches.Length;
         if (num != 0)
         {
             bool        flag            = false;
             TouchNotify touchNotify     = new TouchNotify();
             string      loadedLevelName = Application.loadedLevelName;
             touchNotify.scene = loadedLevelName;
             int num2 = 0;
             while (num2 < num && num2 < 5)
             {
                 Touch touch = touches[num2];
                 global::u.c("Touch delta time = {0},x = {1},y={2} ,fingerId = {3},phase = {4}", new object[]
                 {
                     touch.deltaTime *Time.timeScale,
                     touch.position.x,
                     touch.position.y,
                     touch.fingerId,
                     touch.phase
                 });
                 if (touch.phase == TouchPhase.Began && !flag)
                 {
                     GameObject gameObject = null;
                     try
                     {
                         gameObject = x.a(new Point(touch.position.x, touch.position.y));
                     }
                     catch (Exception ex)
                     {
                         global::u.d(ex.StackTrace);
                     }
                     if (gameObject != null && x.a(gameObject))
                     {
                         flag = true;
                         string text = global::g.b(gameObject);
                         global::u.c("Touch UI = " + text);
                         touchNotify.name = text;
                     }
                 }
                 if (touch.phase != TouchPhase.Canceled && touch.phase != TouchPhase.Stationary && touch.phase != TouchPhase.Moved)
                 {
                     TouchData touchData = new TouchData();
                     touchData.deltatime = (float)(DateTime.Now.Ticks / 10000L - this.a);
                     touchData.fingerId  = (short)touch.fingerId;
                     Point point = CoordinateTool.ConvertUnity2Mobile(touch.position);
                     touchData.x         = point.X;
                     touchData.y         = point.Y;
                     touchData.relativeX = touch.position.x / (float)Screen.width;
                     touchData.relativeY = ((float)Screen.height - touch.position.y) / (float)Screen.height;
                     TouchPhase phase = touch.phase;
                     if (phase != TouchPhase.Began)
                     {
                         if (phase == TouchPhase.Ended)
                         {
                             touchData.phase = 2;
                         }
                     }
                     else
                     {
                         touchData.phase = 1;
                     }
                     touchNotify.touches.Add(touchData);
                 }
                 num2++;
             }
             if (touchNotify.touches.Count > 0)
             {
                 j.b = touchNotify;
                 global::o.a(j);
             }
         }
     }
     catch (Exception ex2)
     {
         global::u.a(ex2.Message + "\n" + ex2.StackTrace);
         Cmd a_2 = Cmd.TOUCH_NOTIFY;
         global::o.a(new j(a_2, this.n)
         {
             b = ex2.Message + "\n" + ex2.StackTrace,
             f = ResponseStatus.UN_KNOW_ERROR
         });
     }
 }