Example #1
0
 public virtual void Execute()
 {
     ActionNode3_key = EnumValueNode1;
     // ActionNode
     // Visit uFrame.Actions.InputLibrary.IsKeyDown
     ActionNode3_Result = uFrame.Actions.InputLibrary.IsKeyDown(ActionNode3_key, ActionNode3_yes, ActionNode3_no);
 }
Example #2
0
        void Start()
        {
            if (!GTIConfig.CameraFocusChanger.Activate || PluginExists("CameraFocusChanger"))
            {
                Destroy(this);
                return;
            }

            GTIDebug.Log("Starting GTI_CameraFocusChanger");

            //DebugPrint("Starting Camera Focus Changer");
            flightCamera            = FlightCamera.fetch;
            pivotTranslateSharpness = 0.5f;
            hasReachedTarget        = false;
            isFocusing = false;

            PluginConfiguration config = PluginConfiguration.CreateForType <GTI_CameraFocusChanger>();

            config.load();
            actionKey         = config.GetValue <KeyCode>("actionKey", KeyCode.O);
            showUpdateMessage = config.GetValue <bool>("showUpdateMessage", true);

            GameEvents.OnCameraChange.Add(OnCameraChange);
            GameEvents.onVesselChange.Add(OnVesselChange);
            GameEvents.onVesselWillDestroy.Add(OnVesselWillDestroy);
            GameEvents.onVesselGoOnRails.Add(OnVesselGoOnRails);
            GameEvents.onStageSeparation.Add(OnStageSeparation);
            GameEvents.onUndock.Add(OnUndock);

            API.SetInstance(this);
        }
Example #3
0
    void Start()
    {
        if (eyelink_involved)
        {
            Screen.SetResolution(1024, 768, false, 60);
        }
        else
        {
            Screen.SetResolution(1024, 768, true, 60);
        }

        if (fMRI_key)
        {
            key_one   = KeyCode.Alpha1;
            key_two   = KeyCode.Alpha2;
            key_three = KeyCode.Alpha3;
        }
        else if (!fMRI_key)
        {
            key_one   = KeyCode.W;
            key_two   = KeyCode.O;
            key_three = KeyCode.P;
        }
        input_exp_information = true;
    }
Example #4
0
 public _HotKey(Control hwnd, int id, UnityEngine.EventModifiers modifier, UnityEngine.KeyCode key)
 {
     this.hWnd     = hwnd;
     this.Id       = id;
     this.Modifier = modifier;
     this.Key      = key;
 }
Example #5
0
 internal dfKeyEventArgs(dfControl source, UnityEngine.KeyCode Key, bool Control, bool Shift, bool Alt) : base(source)
 {
     this.KeyCode = Key;
     this.Control = Control;
     this.Shift   = Shift;
     this.Alt     = Alt;
 }
 public virtual void Execute()
 {
     ActionNode3_key = EnumValueNode1;
     // ActionNode
     // Visit uFrame.Actions.InputLibrary.IsKeyDown
     ActionNode3_Result = uFrame.Actions.InputLibrary.IsKeyDown(ActionNode3_key, ActionNode3_yes, ActionNode3_no);
 }
Example #7
0
 void Start()
 {
     Screen.SetResolution(1024, 768, true, 60);
     key_one               = KeyCode.W;
     key_two               = KeyCode.O;
     key_three             = KeyCode.P;
     input_exp_information = true;
 }
Example #8
0
 void Start()
 {
     Screen.SetResolution(1024, 768, true, 60);
     Cursor.visible        = true;
     key_one               = KeyCode.W;
     key_two               = KeyCode.O;
     input_exp_information = true;
 }
Example #9
0
 public void In(
     [FriendlyName("Key Code", "The key to listen for events from.")]
     UnityEngine.KeyCode KeyCode
     )
 {
     m_InputDown = UnityEngine.Input.GetKeyDown(KeyCode);
     m_InputHeld = UnityEngine.Input.GetKey(KeyCode);
     m_InputUp   = UnityEngine.Input.GetKeyUp(KeyCode);
 }
Example #10
0
 public EditorKeyDefinition(string prefsName, UnityEngine.KeyCode defKey, bool defShift, bool defControl, bool defAlt, bool defCommand)
 {
     Name    = prefsName;
     Key     = (UnityEngine.KeyCode)EditorPrefs.GetInt(Name + "_Key", (int)defKey);
     Shift   = EditorPrefs.GetBool(Name + "_Shift", defShift);
     Control = EditorPrefs.GetBool(Name + "_Control", defControl);
     Alt     = EditorPrefs.GetBool(Name + "_Alt", defAlt);
     Command = EditorPrefs.GetBool(Name + "_Command", defCommand);
 }
 public bool GetKeyDown(UnityEngine.KeyCode name)
 {
     if (activePrompt == null && !explicitlyDisabled)
     {
         return(Input.GetKeyDown(name));
     }
     else
     {
         return(false);
     }
 }
Example #12
0
 /// <summary>
 /// Retrieve an SFKeyCode for a Unity KeyCode if a mapping exists, otherwise return Code.None
 /// </summary>
 /// <param name="unityKeyCode">The incoming UnityEngine.KeyCode to find a mapping for.</param>
 public static Code GetSFKeyCode(UnityEngine.KeyCode unityKeyCode)
 {
     if (SFKeyDictionary.ContainsKey(unityKeyCode))
     {
         return(SFKeyDictionary[unityKeyCode]);
     }
     else
     {
         return(Code.None);
     }
 }
Example #13
0
        public void OnGUI(string displayName, string tooltip)
        {
            Key = (UnityEngine.KeyCode)EditorGUILayout.EnumPopup(new GUIContent(displayName, tooltip), Key);

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            Shift   = GUILayout.Toggle(Shift, "Shift");
            Control = GUILayout.Toggle(Control, "Ctrl");
            Alt     = GUILayout.Toggle(Alt, "Alt");
            Command = GUILayout.Toggle(Command, "Cmd");
            EditorGUILayout.EndHorizontal();
        }
Example #14
0
        public static bool IsSpecialKey(UnityEngine.KeyCode key)
        {
            foreach (UnityEngine.KeyCode keyCode in m_SpecialKeys)
            {
                if (keyCode == key)
                {
                    return(true);
                }
            }

            return(false);
        }
 public virtual System.Collections.IEnumerator Execute()
 {
     ActionNode36_key = EnumValueNode35;
     // ActionNode
     while (this.DebugInfo("83d8ad23-6878-4a2c-806f-6a06a0d14dfb", "155e0bed-d68e-4720-898a-a9a8cbe96ae0", this) == 1)
     {
         yield return(null);
     }
     // Visit uFrame.ECS.Actions.InputLibrary.IsKeyDown
     ActionNode36_Result = uFrame.ECS.Actions.InputLibrary.IsKeyDown(ActionNode36_key, () => { System.StartCoroutine(ActionNode36_yes()); }, () => { System.StartCoroutine(ActionNode36_no()); });
     yield break;
 }
Example #16
0
    static bool Input_GetKeyUp__KeyCode(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 1)
        {
            UnityEngine.KeyCode arg0 = (UnityEngine.KeyCode)JSApi.getEnum((int)JSApi.GetType.Arg);
            JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(UnityEngine.Input.GetKeyUp(arg0)));
        }

        return(true);
    }
Example #17
0
        public static bool FindKey(UnityEngine.KeyCode key, UnityEngine.KeyCode[] keys)
        {
            for (int i = 0; i < keys.Length; ++i)
            {
                if (keys[i] == key)
                {
                    return(true);
                }
            }

            return(false);
        }
        void Start()
        {
            //print("Starting Camera Focus Changer");
            flightCamera = FlightCamera.fetch;
            pivotTranslateSharpness = 0.5f;
            hasReachedTarget = false;
            isFocusing = false;

            PluginConfiguration config = PluginConfiguration.CreateForType<CameraFocusChanger>();
            config.load();
            actionKey = config.GetValue<KeyCode>("actionKey");
        }
Example #19
0
    void ControlCameraMovement()
    {
        UnityEngine.KeyCode ROT_RIGHT   = KeyCode.D;
        UnityEngine.KeyCode ROT_LEFT    = KeyCode.A;
        UnityEngine.KeyCode TRANS_FORW  = KeyCode.UpArrow;
        UnityEngine.KeyCode TRANS_BACK  = KeyCode.DownArrow;
        UnityEngine.KeyCode TRANS_UP    = KeyCode.W;
        UnityEngine.KeyCode TRANS_DOWN  = KeyCode.S;
        UnityEngine.KeyCode TRANS_LEFT  = KeyCode.LeftArrow;
        UnityEngine.KeyCode TRANS_RIGHT = KeyCode.RightArrow;

        if (Input.GetKey(ROT_RIGHT))
        {
            player.RotateRight();
        }

        if (Input.GetKey(ROT_LEFT))
        {
            player.RotateLeft();
        }

        if (Input.GetKey(TRANS_RIGHT))
        {
            player.TranslateRight();
        }

        if (Input.GetKey(TRANS_LEFT))
        {
            player.TranslateLeft();
        }

        if (Input.GetKey(TRANS_UP))
        {
            player.TranslateUp();
        }

        if (Input.GetKey(TRANS_DOWN))
        {
            player.TranslateDown();
        }

        if (Input.GetKey(TRANS_BACK))
        {
            player.TranslateBack();
        }

        if (Input.GetKey(TRANS_FORW))
        {
            player.TranslateForward();
        }
    }
 static void Event_keyCode(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Event _this = (UnityEngine.Event)vc.csObj;
         var result = _this.keyCode;
         JSApi.setEnum((int)JSApi.SetType.Rval, (int)result);
     }
     else
     {
         UnityEngine.KeyCode arg0  = (UnityEngine.KeyCode)JSApi.getEnum((int)JSApi.GetType.Arg);
         UnityEngine.Event   _this = (UnityEngine.Event)vc.csObj;
         _this.keyCode = arg0;
     }
 }
Example #21
0
    void ControlGameObjects()
    {
        UnityEngine.KeyCode GEN_BALL = KeyCode.Space;
        UnityEngine.KeyCode DEL_BALL = KeyCode.X;

        if (Input.GetKeyDown(GEN_BALL))
        {
            app.Notify(Notification.ShootSphere, this);
        }

        if (Input.GetKeyDown(DEL_BALL))
        {
            app.Notify(Notification.DeleteSphere, this);
        }
    }
Example #22
0
        private void CheckAndUpdateSelectedLog(K key)
        {
            const float coolTimeFirst = 0.3f;

            if (_curUpDownKey != key && (Input.GetKeyDown(key) || Input.GetKey(key)))
            {
                _curUpDownKey = key;
                UpDownSelectedLogWithCurKey(coolTimeFirst);
            }
            else if (_curUpDownKey == key && (Input.GetKeyUp(key) || !Input.GetKey(key)))
            {
                _curUpDownKey   = K.None;
                _upDownTimeLeft = coolTimeFirst;
            }
        }
Example #23
0
 public static int GetKeyUp1_wrap(long L)
 {
     try
     {
         UnityEngine.KeyCode arg0 = (UnityEngine.KeyCode)(FCLibHelper.fc_get_int(L, 0));
         bool ret     = Input.GetKeyUp(arg0);
         long ret_ptr = FCLibHelper.fc_get_return_ptr(L);
         FCLibHelper.fc_set_value_bool(ret_ptr, ret);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
    private void KeyboardStuff()
    {
        if (king == null)
        {
            return;
        }

        for (int i = 0; i < engineKeyCodes.Length; i++)
        {
            UnityEngine.KeyCode keyCode = engineKeyCodes[i];
            if (UnityEngine.Input.GetKeyDown(keyCode))
            {
                king.IgniteEngines(new int[1] {
                    i
                });
            }
            if (UnityEngine.Input.GetKeyUp(keyCode))
            {
                king.QuenchEngines(new int[1] {
                    i
                });
            }
        }
        for (int i = 0; i < launcherKeyCodes.Length; i++)
        {
            UnityEngine.KeyCode keyCode = launcherKeyCodes[i];
            if (UnityEngine.Input.GetKeyDown(keyCode))
            {
                king.Fire(new int[1] {
                    i
                });
            }
        }
        for (int i = 0; i < teamNames.Count; i++)
        {
            UnityEngine.KeyCode keyCode = bayKeyCodes[i];
            if (UnityEngine.Input.GetKeyDown(keyCode))
            {
                VesselManager.Instance().BuildVessel(true,
                                                     new List <Vessel>()
                {
                    king
                },
                                                     teamNames[i],
                                                     teamNames[i]);
            }
        }
    }
Example #25
0
    public Rocket(string name, float value, UnityEngine.KeyCode key, int index)
    {
        this.name                = name;
        this.value               = value;
        this.key                 = key;
        this.index               = index;
        warning_fuel             = GameObject.Find("warning_fuel_" + index).GetComponent <Text>();
        warning_fuel.text        = "";
        warning_temperature      = GameObject.Find("warning_temperature_" + index).GetComponent <Text>();
        warning_temperature.text = "";
        component                = GameObject.Find(name);
        renderer                 = component.GetComponent <Renderer>();

        shield         = component.transform.Find("Capsule");
        shieldRenderer = shield.GetComponent <Renderer>();
    }
Example #26
0
        public static bool TryPollKey(out UnityEngine.KeyCode key, ButtonState state = ButtonState.Down)
        {
            if (_allKeyCodes == null)
            {
                _allKeyCodes = System.Enum.GetValues(typeof(UnityEngine.KeyCode)) as UnityEngine.KeyCode[];
            }

            key = KeyCode.None;
            for (int i = 0; i < _allKeyCodes.Length; i++)
            {
                switch (state)
                {
                case ButtonState.None:
                    if (!UnityEngine.Input.GetKey(_allKeyCodes[i]))
                    {
                        key = _allKeyCodes[i];
                        return(true);
                    }
                    break;

                case ButtonState.Down:
                    if (UnityEngine.Input.GetKeyDown(_allKeyCodes[i]))
                    {
                        key = _allKeyCodes[i];
                        return(true);
                    }
                    break;

                case ButtonState.Held:
                    if (UnityEngine.Input.GetKey(_allKeyCodes[i]))
                    {
                        key = _allKeyCodes[i];
                        return(true);
                    }
                    break;

                case ButtonState.Released:
                    if (UnityEngine.Input.GetKeyUp(_allKeyCodes[i]))
                    {
                        key = _allKeyCodes[i];
                        return(true);
                    }
                    break;
                }
            }
            return(false);
        }
Example #27
0
    /// <summary>
    /// AƱade un evento de teclado que responde a un KeyCode.
    /// </summary>
    /// <param name="type">1 = OnBegin, 2 = Continuous, 3 = OnRelease.</param>
    /// <param name="Input">Tecla que identifica al evento.</param>
    /// <param name="Evento">Evento a ejecutar.</param>
    public void AddSimpleInputEvent(InputEventType type, UnityEngine.KeyCode Input, Action Evento)
    {
        if (!_controller.keys.Contains(Input))
        {
            _controller.keys.Add(Input);
        }

        switch (type)
        {
        case InputEventType.OnBegin:
            if (!_controller.OnBeginKeyCode.ContainsKey(Input))
            {
                _controller.OnBeginKeyCode.Add(Input, Evento);
            }
            else
            {
                _controller.OnBeginKeyCode[Input] += Evento;
            }
            break;

        case InputEventType.Continious:
            if (!_controller.OnKeyCode.ContainsKey(Input))
            {
                _controller.OnKeyCode.Add(Input, Evento);
            }
            else
            {
                _controller.OnKeyCode[Input] += Evento;
            }
            break;

        case InputEventType.OnRelease:
            if (!_controller.OnReleaseKeyCode.ContainsKey(Input))
            {
                _controller.OnReleaseKeyCode.Add(Input, Evento);
            }
            else
            {
                _controller.OnReleaseKeyCode[Input] += Evento;
            }
            break;

        default:
            break;
        }
    }
Example #28
0
 public static int GetKeyDown1_wrap(long L)
 {
     try
     {
         long  nThisPtr           = FCLibHelper.fc_get_inport_obj_ptr(L);
         Input obj                = get_obj(nThisPtr);
         UnityEngine.KeyCode arg0 = (UnityEngine.KeyCode)(FCLibHelper.fc_get_int(L, 0));
         bool ret     = Input.GetKeyDown(arg0);
         long ret_ptr = FCLibHelper.fc_get_return_ptr(L);
         FCLibHelper.fc_set_value_bool(ret_ptr, ret);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
Example #29
0
    // Start is called before the first frame update
    void Start()
    {
        rb = GetComponent <Rigidbody2D>();
        //anim = GetComponentInChildren<Animator>();

        players = new ArrayList();

        up       = typePlayer == 0 ? KeyCode.UpArrow : KeyCode.W;
        down     = typePlayer == 0 ? KeyCode.DownArrow : KeyCode.S;
        left     = typePlayer == 0 ? KeyCode.LeftArrow : KeyCode.A;
        right    = typePlayer == 0 ? KeyCode.RightArrow : KeyCode.D;
        kdisparo = typePlayer == 0 ? KeyCode.M : KeyCode.Q;

        initUp    = up;
        initDown  = down;
        initLeft  = left;
        initRight = right;
    }
Example #30
0
        private static int UpDownAmountForKey(K key)
        {
            switch (key)
            {
            case K.UpArrow: return(-1);

            case K.DownArrow: return(1);

            case K.PageUp: return(-5);

            case K.PageDown: return(5);

            case K.Home: return(-10000);

            case K.End: return(10000);

            default: return(0);
            }
        }
Example #31
0
    float getAxisDirection(UnityEngine.KeyCode negative, UnityEngine.KeyCode positive)
    {
        bool neg = Input.GetKey(negative);
        bool pos = Input.GetKey(positive);

        if (pos && neg)
        {
            return(0);
        }
        else if (neg)
        {
            return(-1);
        }
        else if (pos)
        {
            return(1);
        }
        else
        {
            return(0);
        }
    }
Example #32
0
    // Start is called before the first frame update
    void Start()
    {
        bmsLoader     = FindObjectOfType <BmsLoader>();
        scoreManager  = FindObjectOfType <ScoreManager>();
        effectManager = FindObjectOfType <EffectManager>();

        scoreManager.initialize();

        if (this.gameObject.name.CompareTo("JudgementLine1") == 0)
        {
            KeyboardKey = KeyCode.A;
        }
        else if (this.gameObject.name.CompareTo("JudgementLine2") == 0)
        {
            KeyboardKey = KeyCode.S;
        }
        else if (this.gameObject.name.CompareTo("JudgementLine3") == 0)
        {
            KeyboardKey = KeyCode.D;
        }
        else if (this.gameObject.name.CompareTo("JudgementLine4") == 0)
        {
            KeyboardKey = KeyCode.F;
        }
        else if (this.gameObject.name.CompareTo("JudgementLine5") == 0)
        {
            KeyboardKey = KeyCode.G;
        }
        else if (this.gameObject.name.CompareTo("JudgementLine6") == 0)
        {
            KeyboardKey = KeyCode.H;
        }
        else if (this.gameObject.name.CompareTo("JudgementLine7") == 0)
        {
            KeyboardKey = KeyCode.J;
        }

        Debug.Log(this.gameObject.name + KeyboardKey);
    }
Example #33
0
 public _HotKey(Control hwnd, int id, UnityEngine.EventModifiers modifier, UnityEngine.KeyCode key)
 {
     this.hWnd = hwnd;
     this.Id = id;
     this.Modifier = modifier;
     this.Key = key;
 }
 void Relay_In_38()
 {
    {
       {
          logic_uScriptAct_OnInputEventFilter_KeyCode_38 = TOP;
          
       }
    }
    logic_uScriptAct_OnInputEventFilter_uScriptAct_OnInputEventFilter_38.In(logic_uScriptAct_OnInputEventFilter_KeyCode_38);
    
    //save off values because, if there are multiple, our relay logic could cause them to change before the next value is tested
    bool test_0 = logic_uScriptAct_OnInputEventFilter_uScriptAct_OnInputEventFilter_38.KeyDown;
    
    if ( test_0 == true )
    {
       Relay_In_9();
       Relay_SendCustomEvent_54();
    }
 }
        void Start()
        {
            DebugPrint("Starting Camera Focus Changer");
            flightCamera = FlightCamera.fetch;
            pivotTranslateSharpness = 0.5f;
            hasReachedTarget = false;
            isFocusing = false;

            PluginConfiguration config = PluginConfiguration.CreateForType<CameraFocusChanger>();
            config.load();
            actionKey = config.GetValue<KeyCode>("actionKey", KeyCode.O);
            showUpdateMessage = config.GetValue<bool>("showUpdateMessage", true);

            GameEvents.OnCameraChange.Add(OnCameraChange);
            GameEvents.onVesselChange.Add(OnVesselChange);
            GameEvents.onVesselWillDestroy.Add(OnVesselWillDestroy);
            GameEvents.onVesselGoOnRails.Add(OnVesselGoOnRails);
            GameEvents.onStageSeparation.Add(OnStageSeparation);
            GameEvents.onUndock.Add(OnUndock);

            API.SetInstance(this);
        }