Ejemplo n.º 1
0
 /// <summary>
 ///     Renders a key bind option.
 /// </summary>
 private static void RenderKeyBind(string name, KeyCode currentBinding, Action <KeyCode> acceptClicked)
 {
     GUILayout.BeginHorizontal();
     GUILayout.Label(name);
     if (GUILayout.Button(currentBinding.ToString(), HighLogic.Skin.button, GUILayout.Width(100.0f)))
     {
         KeyBindPopup.Show(name, currentBinding, acceptClicked);
     }
     GUILayout.EndHorizontal();
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Shows a key bind popup allowing the user to select a key for binding.
        /// </summary>
        public static void Show(string name, KeyCode currentBinding, Action <KeyCode> acceptClicked)
        {
            if (instance == null)
            {
                instance = new GameObject("SelectKeyBind").AddComponent <KeyBindPopup>();
            }

            instance.Name          = name;
            instance.Binding       = currentBinding;
            instance.AcceptClicked = acceptClicked;
        }
Ejemplo n.º 3
0
 /// <summary>
 ///     Called by unity when the component is created.
 /// </summary>
 protected virtual void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         OnCancel();
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        ///     Shows a key bind popup allowing the user to select a key for binding.
        /// </summary>
        public static void Show(string name, KeyCode currentBinding, Action<KeyCode> acceptClicked)
        {
            if (instance == null)
            {
                instance = new GameObject("SelectKeyBind").AddComponent<KeyBindPopup>();
            }

            instance.Name = name;
            instance.Binding = currentBinding;
            instance.AcceptClicked = acceptClicked;
        }
Ejemplo n.º 5
0
 /// <summary>
 ///     Called by unity when the component is created.
 /// </summary>
 protected virtual void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         OnCancel();
     }
 }