void Start() { if (m_InitializeOnStart && !m_HasBeenInitialized) { Initialize(); // Now load the URL. LoadURL(m_URL); //while (m_WebView.IsLoading) //{ // AwesomiumUnityWebCore.Update(); //} } m_Trigger = gameObject.GetComponent <PointerTrigger>(); if (!m_Trigger) { m_Trigger = gameObject.AddComponent <PointerTrigger>(); } #region Subscribe_to_PointerTrigger_Events //NOTE: if you want non-PointerEventData events e.g. BaseEventData like ISelectHandler which requires "void OnSelect(BaseEventData dat)" //then you need to implement those interfaces OUTSIDE/WITHOUT PointerEvent.cs Script! i.e. here in this class. m_Trigger.Subscribe(PointerEventType.PointerEnter, myMouseEnter); m_Trigger.Subscribe(PointerEventType.PointerExit, myMouseExit); m_Trigger.Subscribe(PointerEventType.PointerDown, myMouseDown); m_Trigger.Subscribe(PointerEventType.PointerUp, myMouseUp); m_Trigger.Subscribe(PointerEventType.Scroll, myMouseScroll); m_Trigger.Subscribe(PointerEventType.BeginDrag, myBeginDrag); m_Trigger.Subscribe(PointerEventType.Drag, myDrag); m_Trigger.Subscribe(PointerEventType.EndDrag, myEndDrag); #endregion }
void Start() { if (m_InitializeOnStart && !m_HasBeenInitialized) { Initialize(); // Now load the URL. LoadURL(m_URL); //while (m_WebView.IsLoading) //{ // AwesomiumUnityWebCore.Update(); //} } m_Trigger = gameObject.GetComponent<PointerTrigger>(); if (!m_Trigger) { m_Trigger = gameObject.AddComponent<PointerTrigger>(); } #region Subscribe_to_PointerTrigger_Events //NOTE: if you want non-PointerEventData events e.g. BaseEventData like ISelectHandler which requires "void OnSelect(BaseEventData dat)" //then you need to implement those interfaces OUTSIDE/WITHOUT PointerEvent.cs Script! i.e. here in this class. m_Trigger.Subscribe(PointerEventType.PointerEnter, myMouseEnter); m_Trigger.Subscribe(PointerEventType.PointerExit, myMouseExit); m_Trigger.Subscribe(PointerEventType.PointerDown, myMouseDown); m_Trigger.Subscribe(PointerEventType.PointerUp, myMouseUp); m_Trigger.Subscribe(PointerEventType.Scroll, myMouseScroll); m_Trigger.Subscribe(PointerEventType.BeginDrag, myBeginDrag); m_Trigger.Subscribe(PointerEventType.Drag, myDrag); m_Trigger.Subscribe(PointerEventType.EndDrag, myEndDrag); #endregion }
private void Start() { PointerTrigger.AddEvent(gameObject, EventTriggerType.PointerDown, this, PointerDown); PointerTrigger.AddEvent(gameObject, EventTriggerType.Drag, this, PointerDrag); PointerTrigger.AddEvent(gameObject, EventTriggerType.PointerUp, this, PointerUp); }