本文整理汇总了C#中InputField类的典型用法代码示例。如果您正苦于以下问题:C# InputField类的具体用法?C# InputField怎么用?C# InputField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputField类属于命名空间,在下文中一共展示了InputField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
protected virtual void Awake()
{
// Call the base class's function to initialize all variables
base.Awake();
Assert.raiseExceptions = true;
mmsBack = GameObject.Find("MMS_Backdrop");
if (mmsBack != null)
{
mmsBack.SetActive(false);
}
//Make sure all UI components exist
MMS_NumOfBombsSlider = GameObject.Find("MMS_NumOfBombsSlider").GetComponent<Slider>();
Assert.IsNotNull(MMS_NumOfBombsSlider, "MMS_NumOfBombsSlider not found");
MMS_NumOfBombsText = GameObject.Find("MMS_NumOfBombsText").GetComponent<Text>();
Assert.IsNotNull(MMS_NumOfBombsText, "MMS_NumOfBombsText not found");
MMS_PlanterNameInputField = GameObject.Find("MMS_PlanterNameInputField").GetComponent<InputField>();
Assert.IsNotNull(MMS_PlanterNameInputField, "MMS_PlanterNameInputField not found");
MMS_DefuserNameInputField = GameObject.Find("MMS_DefuserNameInputField").GetComponent<InputField>();
Assert.IsNotNull(MMS_DefuserNameInputField, "MMS_DefuserNameInputField not found");
MMS_NoNameText = GameObject.Find ("MMS_NoNameText").GetComponent<Text>();
Assert.IsNotNull(MMS_NoNameText);
MMS_GameInputField = GameObject.Find ("MMS_GameInputField").GetComponent<InputField>();
Assert.IsNotNull(MMS_GameInputField);
}
示例2: Awake
void Awake()
{
nameText = transform.Find("Info/NameInput").GetComponent<InputField>();
costText = transform.Find("Info/CostInput").GetComponent<InputField>();
preconditionsContainer = transform.Find("Vertical/PreconditionsContainer").GetComponent<Transform>();
postconditionsContainer = transform.Find("Vertical/PostconditionsContainer").GetComponent<Transform>();
}
示例3: Start
void Start()
{
showingObject = false;
selectingTrials = true;
showingSixObjects = false;
objectPicked = false;
maxTimer = 2;
waitingOneSecond = false;
inputGO = GameObject.FindGameObjectWithTag("Input");
input = inputGO.GetComponent<InputField>();
text1 = GameObject.FindGameObjectWithTag("text1");
text2 = GameObject.FindGameObjectWithTag("text2");
text3 = GameObject.FindGameObjectWithTag("text3");
text4 = GameObject.FindGameObjectWithTag("text4");
gameover= GameObject.FindGameObjectWithTag("gameover");
text4.SetActive(false);
text3.SetActive(false);
gameover.SetActive(false);
numObject = 1;
currentRound = 1;
rounds = 2;
score = 0;
}
示例4: Start
// Use this for initialization
void Start()
{
inputText = gameObject.GetComponent<InputField>();
foreach (Transform child in transform)
if (child.name == errorObjectName)
errorObject = child.gameObject;
}
示例5: NextInputField
private void NextInputField( Selectable next, InputField inputField )
{
// If it's an input field, also set the text caret
inputField.OnPointerClick( new PointerEventData( system ) );
EventSystem.current.SetSelectedGameObject( next.gameObject, new BaseEventData( system ) );
}
示例6: Awake
private void Awake()
{
titleControls = GameObject.Find ("Canvas");
btnStart = titleControls.GetComponentInChildren<Button> ();
btnStart.onClick.AddListener (() => btnOnclick ());
inputField = titleControls.GetComponentInChildren<InputField> ();
}
示例7: Awake
void Awake()
{
this.appManager = GameObject.FindGameObjectWithTag("Player").GetComponent<ApplicationManager>();
this.messageControllObj = GameObject.FindGameObjectWithTag("MWindow");
this.controlls = messageControllObj.GetComponent<MessageController>();
this.input = this.gameObject.GetComponent<InputField>();
}
示例8: ValidateField
public void ValidateField(InputField inputfield)
{
Debug.Log("validate field:"+inputfield.name);
Text icon = GameObject.Find (inputfield.name + "_check").GetComponent<Text> ();
bool nameCheck = false;
if(inputfield.name == "p_name") {
if(!nameIsAvailable) {
nameCheck = true;
} else {
nameCheck = false;
}
}
if (inputfield.text == "" || nameCheck) {
Errors = true;
if(!nameCheck) {
changeInputColor (inputfield, error_color);
inputfield.text = getErrorMessage(inputfield.name);
}
// Hide succes icon if visibile
if (icon.enabled) {
icon.enabled = false;
}
} else {
if (inputfield.text != getErrorMessage (inputfield.name)) {
changeInputColor (inputfield, succes_color);
// Show succes icon
icon.enabled = true;
}
}
}
示例9: UpdatehighScore
public void UpdatehighScore(InputField newChallenger)
{
GameControl gameManager = GameObject.Find ("GameControl").GetComponent<GameControl> ();
SqlManager sqlManager = GameObject.Find ("GameControl").GetComponent<SqlManager> ();
StartCoroutine(sqlManager.UpdateBuildingScore(gameManager.getId().ToString(), gameManager.getBestScore ().ToString(), newChallenger.text));
}
示例10: Awake
protected virtual void Awake()
{
// Call the base class's function to initialize all variables
base.Awake();
// Find all UI elements in the scene
PB_MenuTitle = GameObject.Find("PB_MenuTitle").GetComponent<Text>();
PB_TimeLeftText = GameObject.Find("PB_TimeLeftText").GetComponent<Text>();
PB_PassPhoneButton = GameObject.Find("PB_PassPhoneButton").GetComponent<Button>();
PB_HintField = GameObject.Find("PB_HintField").GetComponent<InputField>();
PB_HintField2 = GameObject.Find("PB_HintField2").GetComponent<InputField>();
PB_HintField3 = GameObject.Find("PB_HintField3").GetComponent<InputField>();
PB_InsertHints = GameObject.Find("PB_InsertHints").GetComponent<Button>();
PB_HideHints = GameObject.Find("PB_HideHints").GetComponent<Button>();
PB_PlantBomb = GameObject.Find("PB_PlantBomb").GetComponent<Button>();
PB_Waiting = GameObject.Find ("PB_Waiting").GetComponent<Text>();
PB_ArmTimeLeftText = GameObject.Find("PB_ArmTimeLeftText").GetComponent<Text>();
PB_ReplantBomb = GameObject.Find("PB_ReplantBomb").GetComponent<Button>();
PB_TutorialPlant = GameObject.Find("PB_TutorialPlant").GetComponent<Button>();
PB_TutorialReplant = GameObject.Find("PB_TutorialReplant").GetComponent<Button>();
PB_TutorialHints = GameObject.Find("PB_TutorialHints").GetComponent<Button>();
PB_GiveUp = GameObject.Find ("PB_GiveUp").GetComponent<Button>();
userDefinedTargetHandler = GameObject.Find("UserDefinedTargetBuilder").GetComponent<UserDefinedTargetEventHandler>();
}
示例11: Awake
/*=========================== Methods ===================================================*/
/*=========================== Awake() ===================================================*/
void Awake(){
// initialise variables
lbPanelWidth = Screen.width * 0.28f; // width is 28% screen size
lbPanelHeight = Screen.height * 0.72f; // height is 72% screen height
// get reference to UI Elements
usernameInput = GameObject.Find ("UsernameInputField").GetComponent<InputField>();
playButton = GameObject.Find ("PlayButton").GetComponent<Button> ();
leaderboardButton = GameObject.Find ("LeaderboardButton").GetComponent<Button>();
quitButton = GameObject.Find ("QuitButton").GetComponent<Button>();
// add play game button onclick method
playButton.onClick.AddListener(() => PlayGame());
// add leaderboard button onclick method
leaderboardButton.onClick.AddListener(() => Leaderboard());
// add quit button onclick method
quitButton.onClick.AddListener(() => QuitGame());
// get reference to saveManager
saveManager = GetComponent<SaveGameDataManager>();
// get reference to leaderboard
leaderBoard = GetComponent<LeaderBoard>();
} // Awake()
示例12: Start
void Start()
{
chatText = GameObject.Find("Chat text").GetComponent<Text>();
chatInput = GameObject.Find("Chat input").GetComponent<InputField>();
playerInput = GetComponent<PlayerInput>();
}
示例13: Start
private void Start()
{
m_Transition = GetComponent<ShowAndHidePanel>();
m_AudioSource = GetComponent<AudioSource>();
m_CanvasGroup = GetComponent<CanvasGroup>();
m_CanvasGroup.alpha = 0;
m_FaderPanel = transform.GetChild(0).GetComponent<RectTransform>();
m_UserPanel = transform.GetChild(1).GetComponent<RectTransform>();
m_NameInputValue = m_UserPanel.GetChild(1).GetChild(0).GetComponent<InputField>();
m_EmailInputValue = m_UserPanel.GetChild(1).GetChild(1).GetComponent<InputField>();
m_PasswordInputValue = m_UserPanel.GetChild(1).GetChild(2).GetComponent<InputField>();
m_CancelButton = m_UserPanel.GetChild(2).GetComponent<Button>();
m_CancelButton.onClick.RemoveAllListeners();
m_CancelButton.onClick.AddListener(delegate { Cancel(); });
m_RegisterButton = m_UserPanel.GetChild(3).GetComponent<Button>();
m_RegisterButton.onClick.RemoveAllListeners();
m_RegisterButton.onClick.AddListener(delegate { Register(); });
m_FaderPanel.gameObject.SetActive(false);
m_UserPanel.gameObject.SetActive(false);
}
示例14: Start
void Start()
{
input = this.transform.GetChild(0).gameObject.GetComponent<InputField>();
transform.parent = GameObject.Find("Canvas").transform;
EventSystem.current.SetSelectedGameObject(input.gameObject);
Board.master.currentTextChanger = this;
}
示例15: ApplyMol
public void ApplyMol(InputField passField)
{
if (system.GetComponent<Main> ().SetMolecule (passField.text,false,current_mol)) {
labels_mol[current_mol-1].transform.FindChild ("Label").GetComponent<Text> ().text =passField.text;
system.GetComponent<Main> ().DisplayMolecules (current_mol);
}
}