Пример #1
0
 public void TurnOff(SwitchEventArgs e)
 {
     if (m_switchCoroutine == null)
     {
         m_switchCoroutine = StartCoroutine(TurnOffEnumerator(e));
     }
 }
Пример #2
0
        private IEnumerator TurnOffEnumerator(SwitchEventArgs e)
        {
            var delay = e.m_delay;

            if (delay != 0f)
            {
                yield return(new WaitForSeconds(delay));
            }
            if (m_isOn == 1)
            {
                m_isOn = 0;
                if (m_turnedOff != null)
                {
                    m_turnedOff.Invoke();
                }
                if (m_turnedOffEventHandle != null)
                {
                    m_turnedOffEventHandle(this, e);
                }
            }
            m_switchCoroutine = null;
        }
Пример #3
0
        public void TurnOff()
        {
            var args = new SwitchEventArgs();

            TurnOff(args);
        }