protected GameObject DisplayRow(GameObject parent)
        {
            ButtonProfile profile = Defaults.GetMomentaryButtonProfile(momentaryButtonProfile);

            GameObject row   = Row(parent, "DisplayRow", TextAlignment.Left);
            GameObject label = EmptyChild(row, "Display");

            label.transform.localScale = profile.labelScale;
            Vector3 localPosition = new Vector3(0, 0, profile.labelZ);

            label.transform.localPosition = localPosition;
            TextMesh textMesh = Undoable.AddComponent <TextMesh>(label);

            textMesh.text     = "keyboard display";
            textMesh.fontSize = profile.fontSize;
            textMesh.color    = profile.fontColor;
            textMesh.anchor   = TextAnchor.MiddleCenter;

            KeyboardLabel keyboardLabel = Undoable.AddComponent <KeyboardLabel>(label);

            keyboardLabel.keyboard = keyboard;
            keyboardLabel.textMesh = textMesh;

            BoxCollider boxCollider = Undoable.AddComponent <BoxCollider>(label);

            UpdateBoxColliderFromTextMesh updateBoxCollider = Undoable.AddComponent <UpdateBoxColliderFromTextMesh>(label);

            updateBoxCollider.textMesh    = textMesh;
            updateBoxCollider.boxCollider = boxCollider;

            return(row);
        }
示例#2
0
        protected GameObject Label(GameObject parent, string name, string text)
        {
            PanelContainerProfile pcProfile = Defaults.GetProfile(panelContainerProfile);
            ButtonProfile         profile   = Defaults.GetMomentaryButtonProfile(momentaryButtonProfile);
            GameObject            label     = EmptyChild(parent, name);

            label.transform.localScale = profile.labelScale;
            Vector3 localPosition = new Vector3(0, 0, profile.labelZ);

            label.transform.localPosition = localPosition;
            TextMesh textMesh = Undoable.AddComponent <TextMesh>(label);

            textMesh.text          = text;
            textMesh.fontSize      = profile.fontSize;
            textMesh.color         = profile.fontColor;
            textMesh.characterSize = pcProfile.labelCharacterSize;
            textMesh.anchor        = TextAnchor.MiddleCenter;

            BoxCollider boxCollider = Undoable.AddComponent <BoxCollider>(label);

            UpdateBoxColliderFromTextMesh updateBoxCollider = Undoable.AddComponent <UpdateBoxColliderFromTextMesh>(label);

            updateBoxCollider.textMesh    = textMesh;
            updateBoxCollider.boxCollider = boxCollider;
            return(label);
        }