예제 #1
0
 //used to enable/disable touch/mouse msg to be sent. useful esp when animating
 public static void EventSystem_EnableAllControls(HEVENTSYSTEM h, bool b = true)
 {
     for (int i = 0; i < h.pm.Length; i++)
     {
         h.pm[i].enabled = b;
     }
     h.e.enabled = b;
 }
예제 #2
0
    public static HEVENTSYSTEM EventSystem_AllocHandle()
    {
        EventSystem e = EventSystem.current;

        if (!e)
        {
            //Debug.Log("bad event");
            return(null);
        }

        PointerInputModule[] pm = e.GetComponents <PointerInputModule>();
        if (pm == null)
        {
            //Debug.Log("bad event2");
            return(null);
        }

        HEVENTSYSTEM r = new HEVENTSYSTEM();

        r.e  = e;
        r.pm = pm;
        return(r);
    }