예제 #1
0
        void Start()
        {
            target.pivot = new Vector2(0, 1);

            eventTrigger = GetComponent <EventTrigger>();
            EventUtility.CreateEventTriggerEntry(eventTrigger, EventTriggerType.Drag, OnDrag);
            EventUtility.CreateEventTriggerEntry(eventTrigger, EventTriggerType.EndDrag, OnEndDrag);

            RestrictToScreen();
        }
예제 #2
0
        void Awake()
        {
            eventTrigger = GetComponent <EventTrigger>();
            EventUtility.CreateEventTriggerEntry(eventTrigger, EventTriggerType.Drag, OnDrag);
            EventUtility.CreateEventTriggerEntry(eventTrigger, EventTriggerType.EndDrag, OnEndDrag);

            IEnumerable <IResizeListener> listeners = FindObjectsOfType <MonoBehaviour>().OfType <IResizeListener>();

            foreach (IResizeListener listener in listeners)
            {
                resizeListeners.Add(listener);
            }
        }