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


C# InputField.GetComponent方法代码示例

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


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

示例1: InputFieldSelectedRegister

    public void InputFieldSelectedRegister(InputField _inpf)
    {
        _inpf.transform.FindChild("Text").GetComponent<Text>().color = green;
        _inpf.GetComponent<Image>().sprite = defaultLogin_sprite;
        errorText_go.SetActive(false);

        _inpf.placeholder.gameObject.SetActive(false);

        // Go to LateUpdate
        isInputActive = true;
        currentInpf = _inpf;
    }
开发者ID:gradus1305,项目名称:GalaxyUI,代码行数:12,代码来源:RegisterController.cs

示例2: NewGame

    /**
     * Prepares a text area and an accept button to create a new game
     */
    public void NewGame()
    {
        if (character == null) {
            character = Instantiate (text) as InputField;
            save = Instantiate (apply) as Button;

            character.transform.SetParent(canvas.transform);
            save.transform.SetParent(canvas.transform);

            character.GetComponent<RectTransform>().localPosition = new Vector2(-50, -200);
            save.GetComponent<RectTransform>().localPosition = new Vector2(100, -200);

            save.onClick.AddListener(() => StartGame());
            save.onClick.AddListener(() => GameControl.control.LoadNextScreen("Overworld"));
        }
    }
开发者ID:lucyktan,项目名称:ItTakesAVillage,代码行数:19,代码来源:TitleManager.cs

示例3: InitComponents

    void InitComponents()
    {
        uiPanel = GameObject.Find ("JIVERUI/UIPanel");
        (Instantiate (uiThemePrefab) as GameObject).transform.parent = uiPanel.transform;

        uiTheme = GameObject.FindObjectOfType (typeof(JiverTheme)) as JiverTheme;
        mainPanel = GameObject.Find ("JIVERUI/UIPanel/MainPanel");
        mainPanel.GetComponent<Image> ().sprite = uiTheme.chatFrameBG;

        channelPanel = GameObject.Find ("JIVERUI/UIPanel/ChannelPanel");
        channelPanel.GetComponent<Image> ().sprite = uiTheme.channelListFrameBG;

        gridPannel = GameObject.Find ("JIVERUI/UIPanel/ChannelPanel/ScrollArea/GridPanel");

        txtContent = GameObject.Find("JIVERUI/UIPanel/MainPanel/ScrollArea/TxtContent").GetComponent<Text>();// (Text);
        txtContent.color = uiTheme.messageColor;

        txtTitle = GameObject.Find ("JIVERUI/UIPanel/MainPanel/TxtTitle").GetComponent<Text> ();
        txtTitle.color = uiTheme.titleColor;

        scrollbar = GameObject.Find ("JIVERUI/UIPanel/MainPanel/Scrollbar").GetComponent<Scrollbar>();
        ColorBlock cb = scrollbar.colors;
        cb.normalColor = uiTheme.scrollBarColor;
        cb.pressedColor = uiTheme.scrollBarColor;
        cb.highlightedColor = uiTheme.scrollBarColor;
        scrollbar.colors = cb;
        scrollbar.onValueChanged.AddListener ((float value) => {
            if(value <= 0) {
                autoScroll = true;
                lastTextPositionY = txtContent.transform.position.y;
                return;
            }

            if(lastTextPositionY - txtContent.transform.position.y >= 100) {
                autoScroll = false;
            }

            lastTextPositionY = txtContent.transform.position.y;
        });

        inputMessage = GameObject.Find ("JIVERUI/UIPanel/MainPanel/InputMessage").GetComponent<InputField> ();
        inputMessage.GetComponent<Image> ().sprite = uiTheme.inputTextBG;
        inputMessage.onEndEdit.AddListener ((string msg) => {
            Submit();
        });

        GameObject.Find ("JIVERUI/UIPanel/MainPanel/InputMessage/Placeholder").GetComponent<Text> ().color = uiTheme.inputTextPlaceholderColor;
        GameObject.Find ("JIVERUI/UIPanel/MainPanel/InputMessage/Text").GetComponent<Text> ().color = uiTheme.inputTextColor;

        btnSend = GameObject.Find ("JIVERUI/UIPanel/MainPanel/BtnSend").GetComponent<Button> ();
        btnSend.GetComponent<Image> ().sprite = uiTheme.sendButton;
        btnSend.GetComponentInChildren<Text> ().color = uiTheme.sendButtonColor;
        btnSend.onClick.AddListener (() => {
            Submit();
        });

        btnClan = GameObject.Find ("JIVERUI/UIPanel/MainPanel/BtnClan").GetComponent<Button> ();
        btnClan.GetComponent<Image> ().sprite = uiTheme.chatChannelButtonOff;
        btnClan.onClick.AddListener (() => {
            Connect ("jia_test.Clan");
            SelectTab(TAB_MODE.CLAN);
        });

        btnMainClose = GameObject.Find ("JIVERUI/UIPanel/MainPanel/BtnClose").GetComponent<Button> ();
        btnMainClose.GetComponent<Image> ().sprite = uiTheme.closeButton;
        btnMainClose.onClick.AddListener (() => {
            uiPanel.SetActive(false);
        });

        GameObject.Find ("JIVERUI/UIPanel/ChannelPanel/TxtTitle").GetComponent<Text> ().color = uiTheme.titleColor;

        Scrollbar channelScrollbar = GameObject.Find ("JIVERUI/UIPanel/ChannelPanel/Scrollbar").GetComponent<Scrollbar>();
        cb = channelScrollbar.colors;
        cb.normalColor = uiTheme.scrollBarColor;
        cb.pressedColor = uiTheme.scrollBarColor;
        cb.highlightedColor = uiTheme.scrollBarColor;
        channelScrollbar.colors = cb;

        btnChannel = GameObject.Find ("JIVERUI/UIPanel/MainPanel/BtnChannel").GetComponent<Button> ();
        btnChannel.GetComponent<Image> ().sprite = uiTheme.chatChannelButtonOff;
        btnChannel.onClick.AddListener (() => {
            OpenChannelList();

        });

        btnChannelClose = GameObject.Find ("JIVERUI/UIPanel/ChannelPanel/BtnChannelClose").GetComponent<Button> ();
        btnChannelClose.GetComponent<Image> ().sprite = uiTheme.closeButton;
        btnChannelClose.onClick.AddListener (() => {
            channelPanel.SetActive(false);
        });

        uiPanel.SetActive (true);
        mainPanel.SetActive (true);
        channelPanel.SetActive (false);
    }
开发者ID:voxlovemy,项目名称:jiver-unity-sample,代码行数:95,代码来源:JiverUI.cs

示例4: Start

    void Start()
    {
        timeLimit = 1;
        messageList = new List<GameObject> ();

        messageInputObj = GameObject.Find("InputField");
        messageInput = messageInputObj.GetComponent<InputField>();

        messageFunctions = (MessageInputHelper)messageInput.GetComponent(typeof(MessageInputHelper));

        initMessages ();
    }
开发者ID:martymartin,项目名称:AlloAttentionExperiment,代码行数:12,代码来源:ChatBoxFunctions.cs

示例5: InitComponents

	void InitComponents ()
	{
		uiPanel = GameObject.Find ("SendBirdUnity/UIPanel");
		(Instantiate (uiThemePrefab) as GameObject).transform.parent = uiPanel.transform;

		uiTheme = GameObject.FindObjectOfType (typeof(SendBirdTheme)) as SendBirdTheme;

		#region MenuPanel

		menuPanel = GameObject.Find ("SendBirdUnity/UIPanel/MenuPanel");
		menuPanel.GetComponent<Image> ().sprite = uiTheme.channelListFrameBG;

		var txtMenuTitle = GameObject.Find ("SendBirdUnity/UIPanel/MenuPanel/TxtTitle").GetComponent<Text> ();
		txtMenuTitle.color = uiTheme.titleColor;

		btnConnect = GameObject.Find ("SendBirdUnity/UIPanel/MenuPanel/BtnConnect").GetComponent<Button> ();
		btnConnect.GetComponent<Image> ().sprite = uiTheme.sendButton;
		btnConnect.GetComponent<Image> ().type = Image.Type.Sliced;
		btnConnect.onClick.AddListener (() => {
			nickname = inputUserName.text;
			userId = nickname; // Assign user's unique id.

			if (nickname == null || nickname.Length <= 0) {
				return;
			}

			SendBirdClient.Connect (userId, (user, e) => {
				if (e != null) {
					Debug.Log (e.Code + ": " + e.Message);
					return;
				}


				btnConnect.gameObject.SetActive (false);

				btnOpenChannelList.gameObject.SetActive (true);
				btnStartGroupChannel.gameObject.SetActive (true);
				btnGroupChannelList.gameObject.SetActive (true);

				SendBirdClient.UpdateCurrentUserInfo (nickname, null, (e1) => {
					if (e1 != null) {
						Debug.Log (e.Code + ": " + e.Message);
						return;
					}

				});
			});
		});


		btnOpenChannelList = GameObject.Find ("SendBirdUnity/UIPanel/MenuPanel/BtnOpenChannel").GetComponent<Button> ();
		btnOpenChannelList.GetComponent<Image> ().sprite = uiTheme.sendButton;
		btnOpenChannelList.GetComponent<Image> ().type = Image.Type.Sliced;
		btnOpenChannelList.onClick.AddListener (() => {
			menuPanel.SetActive (false);
			OpenOpenChannelList ();
		});

		btnStartGroupChannel = GameObject.Find ("SendBirdUnity/UIPanel/MenuPanel/BtnStartGroupChannel").GetComponent<Button> ();
		btnStartGroupChannel.GetComponent<Image> ().sprite = uiTheme.sendButton;
		btnStartGroupChannel.GetComponent<Image> ().type = Image.Type.Sliced;
		btnStartGroupChannel.onClick.AddListener (() => {
			menuPanel.SetActive (false);

			OpenUserList ();
		});

		btnGroupChannelList = GameObject.Find ("SendBirdUnity/UIPanel/MenuPanel/BtnGroupChannel").GetComponent<Button> ();
		btnGroupChannelList.GetComponent<Image> ().sprite = uiTheme.sendButton;
		btnGroupChannelList.GetComponent<Image> ().type = Image.Type.Sliced;
		btnGroupChannelList.onClick.AddListener (() => {
			menuPanel.SetActive (false);

			OpenGroupChannelList ();
		});

		inputUserName = GameObject.Find ("SendBirdUnity/UIPanel/MenuPanel/InputUserName").GetComponent<InputField> ();
		inputUserName.GetComponent<Image> ().sprite = uiTheme.inputTextBG;

		#endregion

		#region OpenChannel

		openChannelPanel = GameObject.Find ("SendBirdUnity/UIPanel/OpenChannelPanel");
		openChannelPanel.GetComponent<Image> ().sprite = uiTheme.chatFrameBG;

		txtOpenChannelContent = GameObject.Find ("SendBirdUnity/UIPanel/OpenChannelPanel/ScrollArea/TxtContent").GetComponent<Text> (); // (Text);
		txtOpenChannelContent.color = uiTheme.messageColor;

		txtOpenChannelTitle = GameObject.Find ("SendBirdUnity/UIPanel/OpenChannelPanel/TxtTitle").GetComponent<Text> ();
		txtOpenChannelTitle.color = uiTheme.titleColor;

		openChannelScrollbar = GameObject.Find ("SendBirdUnity/UIPanel/OpenChannelPanel/Scrollbar").GetComponent<Scrollbar> ();

		ColorBlock cb = openChannelScrollbar.colors;
		cb.normalColor = uiTheme.scrollBarColor;
		cb.pressedColor = uiTheme.scrollBarColor;
		cb.highlightedColor = uiTheme.scrollBarColor;
		openChannelScrollbar.colors = cb;
		openChannelScrollbar.onValueChanged.AddListener ((float value) => {
//.........这里部分代码省略.........
开发者ID:smilefam,项目名称:SendBird-Unity,代码行数:101,代码来源:SendBirdUI.cs


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