Beispiel #1
0
            protected IEnumerator DoDelayedRelease(IKeyPress keyPress)
            {
                var time = Time.unscaledTime;

                yield return(keyPress.WaitForKeySent());

                keyPress.Release();
            }
Beispiel #2
0
        /**
         * Helper that implements the common pattern of pressing a KeyPress which may be null
         * and then returning an action to release that key.
         */
        public static Action CallbackPress(IKeyPress keyPress)
        {
            if (keyPress == null)
            {
                return () => { }
            }
            ;

            keyPress.Press();
            return(() => keyPress.Release());
        }