예제 #1
0
        private void TriggerGameObject(GameObject go)
        {
            if (go == null || !go.activeInHierarchy)
            {
                return;
            }
            //send message
            if (!string.IsNullOrEmpty(eTrigger))
            {
                MessageSystem msg = MessageSystem.UF_GetInstance();
                msg.UF_BeginSend();
                msg.UF_PushParam(eTrigger);
                msg.UF_PushParam(this.gameObject);
                msg.UF_PushParam(go);
                for (int k = 0; k < eParams.Length; k++)
                {
                    msg.UF_PushParam(eParams[k]);
                }
                msg.UF_EndSend(DefineEvent.E_TRIGGER_CONTROLLER);
            }

            if (m_UETrigger != null)
            {
                m_UETrigger.Invoke();
            }

            //paly sound
            if (!string.IsNullOrEmpty(eSound))
            {
                AudioManager.UF_GetInstance().UF_Play(eSound);
            }
        }
예제 #2
0
        private void UF_SendUIOperaMessage(string eventName, Object target)
        {
            MessageSystem msg = MessageSystem.UF_GetInstance();

            msg.UF_BeginSend();
            msg.UF_PushParam(eventName);
            for (int k = 0; k < eParams.Length; k++)
            {
                msg.UF_PushParam(eParams [k]);
            }
            msg.UF_PushParam(target);
            msg.UF_EndSend(DefineEvent.E_UI_OPERA);
        }
예제 #3
0
        protected virtual void OnTriggerEnter(Collider other)
        {
            if (other.gameObject.layer == DefineLayer.HitRaycast)
            {
                return;
            }
            if (string.IsNullOrEmpty(eTrigger))
            {
                return;
            }
            if (!string.IsNullOrEmpty(triggerMask))
            {
                if (!GHelper.UF_CheckStringMask(triggerMask, other.tag))
                {
                    return;
                }
            }
            if (m_AttachTarget != null && m_AttachTarget == other.gameObject)
            {
                return;
            }

            //send message
            MessageSystem msg = MessageSystem.UF_GetInstance();

            msg.UF_BeginSend();
            msg.UF_PushParam(eTrigger);
            msg.UF_PushParam(this.gameObject);
            msg.UF_PushParam(other.gameObject);
            for (int k = 0; k < eParams.Length; k++)
            {
                msg.UF_PushParam(eParams[k]);
            }
            msg.UF_EndSend(DefineEvent.E_TRIGGER_CONTROLLER);

            if (m_UETrigger != null)
            {
                m_UETrigger.Invoke();
            }

            //paly sound
            AudioManager.UF_GetInstance().UF_Play(eSound);
            //release?
            if (autoRelese)
            {
                this.Release();
            }
        }
예제 #4
0
        void IEndDragHandler.OnEndDrag(PointerEventData eventData)
        {
            //bool isClose = this.m_tempScale <= this.closeScale;
            bool isClose = this.m_progress >= 1;

            UF_OnReset();
            if (isClose)
            {
                if (!string.IsNullOrEmpty(this.eventName))
                {
                    MessageSystem msg = MessageSystem.UF_GetInstance();
                    msg.UF_BeginSend();
                    msg.UF_PushParam(eventName);
                    for (int k = 0; k < eParams.Length; k++)
                    {
                        msg.UF_PushParam(eParams [k]);
                    }
                    msg.UF_EndSend(DefineEvent.E_UI_OPERA);
                }
                invoke?.Invoke();
            }
        }