Exemplo n.º 1
0
    // Update is called once per frame
    void OnGUI()
    {
        if (sr == null)
        {
            return;
        }

        if (Time.realtimeSinceStartup >= time && once)
        {
            UnityEngine.Event e = UnityEngine.Event.KeyboardEvent(key);

            e.type = (EventType)type;
            string message = time + " " + e.keyCode + " " + e.type;
            Debug.Log("lucky send key " + message);
            gameView.SendEvent(e);

            if ((line = sr.ReadLine()) != null)
            {
                string[] ss = line.Split(' ');
                time = Convert.ToSingle(ss[0]);
                key  = ss[1];
                type = Convert.ToInt32(ss[2]);
            }
            else
            {
                once = false;
                Debug.Log("lucky high 播放完毕");
            }
        }
    }
Exemplo n.º 2
0
 // When rect selecting, we update the selected objects based on which modifier keys are currently held down,
 // so the window needs to repaint.
 void SendCommandsOnModifierKeys()
 {
     m_Window.SendEvent(EditorGUIUtility.CommandEvent(EventCommandNames.ModifierKeysChanged));
 }