Ejemplo n.º 1
0
 private IMCCanvas FindCanvas()
 {
     if (parentUi == null)
     {
         parentUi = this;
     }
     if (parentUi.GetComponent <IMCUIBehaviour>())
     {
         if (parentUi.GetComponent <IMCForm>() == null)
         {
             if (parentUi.parent == null)
             {
                 return(null);
             }
             parentUi = parentUi.parent;
             IMCCanvas canvas;
             if ((canvas = FindCanvas()) != null)
             {
                 return(canvas);
             }
         }
         else
         {
             return(parentUi.GetComponent <IMCForm>().canvas);
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
 public override void OnPointerDown(PointerEventData eventData)
 {
     base.OnPointerDown(eventData);
     if (m_isPlayAudio)//2018年1月3日21:00:21
     {
         if (!canvas)
         {
             canvas = FindCanvas();
         }
         if (canvas)
         {
             if (m_clip)
             {
                 canvas.PlayAudio(m_clip);
             }
             else
             {
                 canvas.PlayAudio(null);
             }
         }
         else if (canvas == null && m_clip)
         {
             AudioSource.PlayClipAtPoint(m_clip, Vector3.zero);
         }
     }
     if (m_isPlayAudio && m_clip != null)
     {
         AudioSource.PlayClipAtPoint(m_clip, Vector3.zero);
     }
 }
Ejemplo n.º 3
0
        public override void OnPointerDown(PointerEventData eventData)
        {
            base.OnPointerDown(eventData);

            if (m_isPlayAudio)//2018年1月3日21:00:21
            {
                if (!canvas)
                {
                    canvas = FindCanvas();
                }
                if (canvas)
                {
                    if (m_clip)
                    {
                        canvas.PlayAudio(m_clip);
                    }
                    else
                    {
                        canvas.PlayAudio(null);
                    }
                }
                else if (canvas == null && m_clip)
                {
                    AudioSource.PlayClipAtPoint(m_clip, Vector3.zero);
                }
            }

            downTime    = 0;
            pointerDown = true;

            if (stipulatedTimeFunctionStartToggle)
            {
                startTime = Time.time;
            }
            if (delayCallToggle)
            {
                delayCallToggle = !delayCallToggle;
                delayCor        = DelayCoroutine(delayTime, delayAction);
                StartCoroutine(delayCor);
            }
        }