Exemplo n.º 1
0
 private void Start()
 {
     GameInput.GameButton[] buttons = GameInput.Buttons;
     for (int i = 0; i < (int)buttons.Length; i++)
     {
         GameInput.GameButton gameButton = buttons[i];
         GameObject           gameObject = (GameObject)UnityEngine.Object.Instantiate(this.lineObject);
         gameObject.transform.parent = base.transform;
         gameObject.GetComponent <OptionsKeyBinding>().Setup(gameButton);
     }
 }
Exemplo n.º 2
0
    public static string GetConfig()
    {
        string empty = string.Empty;

        GameInput.GameButton[] buttons = GameInput.Buttons;
        for (int i = 0; i < (int)buttons.Length; i++)
        {
            GameInput.GameButton gameButton = buttons[i];
            string str = empty;
            empty = string.Concat(new string[] { str, "input.bind ", gameButton.Name, " ", gameButton.bindingOne.ToString(), " ", gameButton.bindingTwo.ToString(), "\n" });
        }
        return(empty);
    }
Exemplo n.º 3
0
 public static GameInput.GameButton GetButton(string strName)
 {
     GameInput.GameButton[] buttons = GameInput.Buttons;
     for (int i = 0; i < (int)buttons.Length; i++)
     {
         GameInput.GameButton gameButton = buttons[i];
         if (gameButton.Name == strName)
         {
             return(gameButton);
         }
     }
     return(null);
 }
Exemplo n.º 4
0
 public void Setup(GameInput.GameButton button)
 {
     this.labelName.Text = button.Name;
     this.keyOne.Text    = button.bindingOne.ToString();
     this.keyTwo.Text    = button.bindingTwo.ToString();
     if (this.keyOne.Text == "None")
     {
         this.keyOne.Text = " ";
     }
     if (this.keyTwo.Text == "None")
     {
         this.keyTwo.Text = " ";
     }
 }
Exemplo n.º 5
0
 public static void bind(ref ConsoleSystem.Arg args)
 {
     if (args.HasArgs(3))
     {
         string strName = args.Args[0];
         string a       = args.Args[1];
         string b       = args.Args[2];
         GameInput.GameButton button = GameInput.GetButton(strName);
         if (button != null)
         {
             button.Bind(a, b);
         }
     }
 }
Exemplo n.º 6
0
    public static void bind(ref ConsoleSystem.Arg args)
    {
        if (!args.HasArgs(3))
        {
            return;
        }
        string str  = args.Args[0];
        string str1 = args.Args[1];
        string str2 = args.Args[2];

        GameInput.GameButton button = GameInput.GetButton(str);
        if (button != null)
        {
            button.Bind(str1, str2);
        }
    }