当前位置: 首页>>代码示例>>C#>>正文


C# InputField.ActivateInputField方法代码示例

本文整理汇总了C#中InputField.ActivateInputField方法的典型用法代码示例。如果您正苦于以下问题:C# InputField.ActivateInputField方法的具体用法?C# InputField.ActivateInputField怎么用?C# InputField.ActivateInputField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InputField的用法示例。


在下文中一共展示了InputField.ActivateInputField方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

 // Use this for initialization
 void Start()
 {
     input = gameObject.GetComponentsInChildren<InputField>()[0];
     input.ActivateInputField();
     input.onEndEdit.AddListener (OnSubmit);
     input.Select();
 }
开发者ID:alebianITBA,项目名称:HCI-Avanzado,代码行数:8,代码来源:FocusNameInputField.cs

示例2: Start

        /// <summary>
        /// Get the `InputField` child object of this gameObject
        /// and activate it so the user does not have to 
        /// click on it prior to entering a number.
        /// </summary>
        public void Start()
        {
            inputField = GetComponentInChildren<InputField>();

            if (inputField == null) {
                throw new MissingComponentException();
            }

            inputField.ActivateInputField();
        }
开发者ID:adampassey,项目名称:collect,代码行数:15,代码来源:StackableSplitter.cs

示例3: SubmitCommand

    public void SubmitCommand(InputField inputField)
    {
        var cmd = inputField.text;
        AppendTextToConsole("> " + cmd + "\n");
        inputField.text = "";
        inputField.Select();
        inputField.ActivateInputField();

        ParseCommand(cmd);
    }
开发者ID:BrianErikson,项目名称:ScriptingTheGame,代码行数:10,代码来源:TosInterface.cs

示例4: Update

    // Update is called once per frame
    void Update()
    {
        if (activeRitual)
        {
            inputFieldObj.SetActive(true);
            inputField = inputFieldObj.GetComponent<InputField>();
            inputField.Select();
            inputField.ActivateInputField();

            if (initRitual == false)
            {
                initRitual = true;
                inputField.text = "Enter Password; ";
            }

            if (Input.GetKeyDown(KeyCode.Return))
            {
                if (passwordEntered == false)
                {
                    passwordEntered = true;
                    if (inputField.text.CompareTo(password) == 0)
                    {
                        passwordCorrect = true;
                        inputField.text = "password correct\nplease right click";
                    }
                    else
                    {
                        passwordCorrect = false;
                        inputField.text = "password incorrect";
                        Application.LoadLevel("level");
                    }
                }
                else
                {
                    inputField.text = DoComputerStuff(inputField.text);
                }
            }

            if (Input.GetMouseButtonDown(1))
            {
                inputFieldObj.SetActive(false);
                activeRitual = false;
                Debug.Log("PC Ritual");
            }
        }
        

    }
开发者ID:christopher-mccreadie,项目名称:RickyRitualStaffsGGJ,代码行数:49,代码来源:PCRitual.cs

示例5: OnInputEnter

 public void OnInputEnter(InputField inputField)
 {
     // First Name only.
     if (Regex.IsMatch (inputField.text, "^[A-Z]?[a-z]{2,14}$"))
     {
         GameManager.Instance.SetPlayerName (inputField.text);
         if(GameManager.Instance.doLoadTutorial)
             Application.LoadLevel ("Tutorial");
         else
             Application.LoadLevel ("Level 1");
     }
     else
     {
         inputField.text = "";
         inputField.placeholder.GetComponent<Text>().text = "Invalid Name";
         inputField.ActivateInputField();
     }
 }
开发者ID:Juanchiselo,项目名称:GAM-52,代码行数:18,代码来源:GUIManager.cs

示例6: EnsureInputFieldCoroutine

    private IEnumerator EnsureInputFieldCoroutine(InputField inputField)
    {
        yield return null;

        while(!TouchScreenKeyboard.visible && inputField.text.Length == 0)
        {
            inputField.ActivateInputField();
            inputField.Select();

            yield return null;
        }
    }
开发者ID:arloistale,项目名称:SlugJam2015,代码行数:12,代码来源:LoginController.cs

示例7: ValChanged

 public void ValChanged(InputField field)
 {
     if (field.text.Length > 0)
     {
     playerName = field.text;
     Application.LoadLevel(7);
     }
     else{
         field.placeholder.GetComponent<Text>().text = "Please enter a name";
         field.ActivateInputField();
         field.Select();
         
     }
 }
开发者ID:Ellesent,项目名称:EcoGalaxy,代码行数:14,代码来源:Button.cs

示例8: ActivateInputFieldWithoutSelection

        IEnumerator ActivateInputFieldWithoutSelection(InputField inputField)
        {
            inputField.ActivateInputField();

            // wait for the activation to occur in a lateupdate
            yield return new WaitForEndOfFrame();

            // make sure we're still the active ui
            if (EventSystem.current.currentSelectedGameObject == inputField.gameObject)
            {
                // To remove hilight we'll just show the caret at the end of the line
                inputField.MoveTextEnd(false);
            }
        }
开发者ID:gzuidhof,项目名称:ahci,代码行数:14,代码来源:CanvasKeyboard.cs


注:本文中的InputField.ActivateInputField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。