• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# InputField类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



InputField类属于命名空间,在下文中一共展示了InputField类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
	}
开发者ID:khoavnguyen,项目名称:Unity-AR-Game-Explode-with-Friends,代码行数:27,代码来源:MultiplayerMenuState.cs


示例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>();
 }
开发者ID:garrafote,项目名称:unity3d-goap,代码行数:7,代码来源:ActionView.cs


示例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;
    }
开发者ID:nickgreenquist,项目名称:UnityGame,代码行数:28,代码来源:ObjectSpawn.cs


示例4: Start

 // Use this for initialization
 void Start()
 {
     inputText = gameObject.GetComponent<InputField>();
     foreach (Transform child in transform)
         if (child.name == errorObjectName)
             errorObject = child.gameObject;
 }
开发者ID:ikids-research,项目名称:ikids-newborn-cognitive-unity,代码行数:8,代码来源:InputFieldNotEmptyEnforcer.cs


示例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 ) );
    }
开发者ID:Keliff,项目名称:UI_Test,代码行数:7,代码来源:InputManager.cs


示例6: Awake

 private void Awake()
 {
     titleControls = GameObject.Find ("Canvas");
     btnStart = titleControls.GetComponentInChildren<Button> ();
     btnStart.onClick.AddListener (() => btnOnclick ());
     inputField = titleControls.GetComponentInChildren<InputField> ();
 }
开发者ID:mduffyg13,项目名称:Honours-Project,代码行数:7,代码来源:TitleContols.cs


示例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>();
 }
开发者ID:EosTA,项目名称:UI,代码行数:7,代码来源:SendMessage.cs


示例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;
            }

        }
    }
开发者ID:Derojo,项目名称:Medical,代码行数:32,代码来源:Profile_Create.cs


示例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));
    }
开发者ID:skardous,项目名称:BuilderAndDestroyer,代码行数:7,代码来源:SaveOnMySQLBuilding.cs


示例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>();
    }
开发者ID:khoavnguyen,项目名称:Unity-AR-Game-Explode-with-Friends,代码行数:25,代码来源:PlantBombState.cs


示例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()
开发者ID:Ross-Byrne,项目名称:PartyCrashingOgresTD,代码行数:33,代码来源:StartGame.cs


示例12: Start

        void Start()
        {
            chatText = GameObject.Find("Chat text").GetComponent<Text>();
            chatInput = GameObject.Find("Chat input").GetComponent<InputField>();

            playerInput = GetComponent<PlayerInput>();
        }
开发者ID:raftelti,项目名称:flamewars,代码行数:7,代码来源:PlayerChat.cs


示例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);
    }
开发者ID:kleberandrade,项目名称:more-rehab-system,代码行数:25,代码来源:RegisterUser.cs


示例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;
 }
开发者ID:Jonanory,项目名称:Reputations,代码行数:7,代码来源:TextChanger.cs


示例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);
     }
 }
开发者ID:sams28,项目名称:Dock-Hap,代码行数:7,代码来源:MainUI.cs


示例16: activateMainGame

    public void activateMainGame()
    {
        if (firstScreenMsg != null)
        {
            Destroy(firstScreenMsg);
            firstScreenMsg = null;
        }

        UICanvas.SetActive(true);
        cardGroup.SetActive(true);

        arrayPlayerCards = new Card[2];
        arrayPlayerCards[0] = GameObject.Find("PlayerCard1").GetComponent<Card>();
        arrayPlayerCards[1] = GameObject.Find("PlayerCard2").GetComponent<Card>();

        arrayOpponentCards = new Card[2];
        arrayOpponentCards[0] = GameObject.Find("OpponentCard1").GetComponent<Card>();
        arrayOpponentCards[1] = GameObject.Find("OpponentCard2").GetComponent<Card>();

        arrayCommonCards = new Card[5];
        for (int i = 0; i < 5; i++)
        {
            string objName = "CommonCard" + (i + 1);
            arrayCommonCards[i] = GameObject.Find(objName).GetComponent<Card>();
        }

        txtOpponentBet = GameObject.Find("txtOpponentBet").GetComponent<Text>();
        txtPlayerBet = GameObject.Find("txtPlayerBet").GetComponent<Text>();
        inpBetAmount = GameObject.Find("inpBetAmount").GetComponent<InputField>();
    }
开发者ID:alanbondarun,项目名称:cs492-week2,代码行数:30,代码来源:GameManager.cs


示例17: Start

 // Use this for initialization
 void Start()
 {
     input = gameObject.GetComponent<InputField>();
     se = new InputField.SubmitEvent();
     se.AddListener(SubmitInput);
     input.onEndEdit = se;
 }
开发者ID:KCK-PROJECT,项目名称:HackYou,代码行数:8,代码来源:console.cs


示例18: GetInt

 public static int GetInt(InputField inputField)
 {
     int value = 0;
     if (!int.TryParse(inputField.text, out value))
         value = 0;
     return value;
 }
开发者ID:Magicolo,项目名称:PseudoFramework,代码行数:7,代码来源:InputFieldUtility.cs


示例19: Start

	// Use this for initialization
	void Start () {
		ipInput = GameObject.Find ("InputField").GetComponent<InputField> ();
		imageNave2 = GameObject.Find ("panelNave2").GetComponent<Image> ();
		imageNave2.enabled = true;
		imageNave = GameObject.Find ("panelNave").GetComponent<Image> ();
		imageNave.enabled = false;
	}
开发者ID:PJEstrada,项目名称:proyecto1-redes,代码行数:8,代码来源:WelcomeScreen.cs


示例20: Start

    // Use this for initialization
    void Start()
    {
        _highScoreCanvas = GetComponentInChildren<Canvas>();
        PlayerNameInputText = _highScoreCanvas.GetComponentInChildren<InputField>();
        if(PlayerNameInputText != null)
        {
            Text[] inputTexts = PlayerNameInputText.gameObject.GetComponentsInChildren<Text>();
            foreach(Text t in inputTexts)
            {
                if (t.name == "Placeholder") t.text = UsersData.DEFAULT_NAME;
            }
        }

        Text[] texts = _highScoreCanvas.GetComponentsInChildren<Text>();
        foreach(Text t in texts)
        {
            t.fontSize = (int)(t.fontSize * ((Screen.width) / 1236f));

            if (t.name.Contains("Player Name")) RankPlayerNameText = t;
            else if(t.name.Contains("Scores")) RankScoreText = t;
        }

        obj_localHighScore = LocalHighScore.getInstance();
        obj_localHighScore.setMaxUser(maxNumOfUsers);
        minScore = obj_localHighScore.getMinScore();

        LoadScores();
    }
开发者ID:ShinWonYoung,项目名称:HGU-SE-15,代码行数:29,代码来源:HighScoreManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# InputFormat类代码示例发布时间:2022-05-24
下一篇:
C# InputEngine类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap