Beispiel #1
0
    /// <summary>
    /// Adds a normal key to keyboard
    /// </summary>
    /// <param name="template">Normal key GameObject template</param>
    /// <param name="pos">Position of the key</param>
    /// <param name="mainChar">Unshifted character</param>
    /// <param name="shiftChar">Shifted character</param>
    void AddKey(GameObject template, Vector2 pos, string mainChar, string shiftChar)
    {
        GameObject key = Instantiate(template, transform);

        KeyboardButton keyboardButton = key.GetComponent <KeyboardButton> ();

        keyboardButton.mainChar  = mainChar;
        keyboardButton.shiftChar = shiftChar;
        keyboardButton.Init();

        key.GetComponent <RectTransform> ().anchoredPosition = pos;

        keyboardButtons.Add(keyboardButton);
    }