Home Game Development unity – How do I exploit an InputField to get names of gamers?

unity – How do I exploit an InputField to get names of gamers?

0
unity – How do I exploit an InputField to get names of gamers?

[ad_1]

I’m making a card-game the place in the beginning the gamers have to jot down their names into an InputField. These names are then used within the recreation. My Problem is I eather get nearly all compiler errors in existance or I cant add the InputField to the script.
I`ve rewritten it aigan and aigan and that is how it’s rn: I’m printing out the names in an Debug.Log, simply to verify if the code will get the names (it doesnt). I’m planning on placing the names in an Array however in the mean time that additionally provides extra error codes then google is aware of.

utilizing System;
utilizing System.Collections;
utilizing System.Collections.Generic;
utilizing System.IO;
utilizing UnityEngine;
utilizing UnityEngine.UI;
utilizing UnityEngine.SceneManagement;

public class namen : MonoBehaviour
{

    public InputField inputNames; //Adds the InputField
    public Button addButton;      //Adds the addButton
    public Button proceedButton; //Adds the proceedButton


    public void getNames()
    {
        Debug.Log(inputNames.textual content);
    }

}

Any concepts how I can repair this drawback?

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here