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


C# Toggle.GetComponentInChildren方法代码示例

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


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

示例1: OnChangeCategory

 public void OnChangeCategory(Toggle toggle)
 {
     this.flipFlag = !this.flipFlag;
     if (this.flipFlag) {
         Text text = toggle.GetComponentInChildren<Text>();
         if (text != null) {
             this.selectedToggle = text.text;
         }
     }
 }
开发者ID:tommai78101,项目名称:Multiplier,代码行数:10,代码来源:CategoryHandler.cs

示例2: InitialisePage

    private void InitialisePage(int page, Toggle toggle)
    {
        toggle.onValueChanged.RemoveAllListeners();
        toggle.onValueChanged.AddListener(active =>
        {
            if (active) SetPage(page);
        });

        toggle.GetComponentInChildren<Text>().text = (page + 1).ToString();
    }
开发者ID:Ragzouken,项目名称:smooltool,代码行数:10,代码来源:TilePalette.cs

示例3: ClickToggle

        public void ClickToggle(Toggle clicked)
        {
            SoundController.GetController().PlayClickSound();

            if (lastToggle != null) lastToggle.isOn = false;
            if (clicked.isOn)
            {
                lastToggle = clicked;
                resultNumber.text = clicked.GetComponentInChildren<Text>().text;
            }
            else {
                lastToggle = null;
                resultNumber.text = "";
            }
            UpdateTryButton();
        }
开发者ID:NashIlli,项目名称:calculandox,代码行数:16,代码来源:FourInLineView.cs

示例4: LoadUnityUI

        public override void LoadUnityUI(AC.Menu _menu)
        {
            uiToggle = LinkUIElement <Toggle>();

            if (uiToggle)
            {
                if (uiToggle.GetComponentInChildren <Text>())
                {
                    uiText = uiToggle.GetComponentInChildren <Text>();
                }
                uiToggle.onValueChanged.AddListener ((isOn) => {
                    ProcessClick (_menu, 0, KickStarter.playerInput.mouseState);
                });
            }
        }
开发者ID:IJkeB,项目名称:Ekster_Final,代码行数:15,代码来源:MenuToggle.cs

示例5: Awake

	// ######################################################################
	// MonoBehaviour Functions
	// ######################################################################
	
	#region MonoBehaviour

	// Awake is called when the script instance is being loaded.
	void Awake()
	{
		
		#if HOTWEEN
		#elif ITWEEN
		#else
		// HOTween: https://www.assetstore.unity3d.com/#/content/3311 Documentation:  http://www.holoville.com/hotween/documentation.html
		// LeanTween: https://www.assetstore.unity3d.com/#/content/3595 Documentation: http://dentedpixel.com/LeanTweenDocumentation/classes/LeanTween.html
		// iTween: https://www.assetstore.unity3d.com/#/content/84 Documentation: http://itween.pixelplacement.com/documentation.php
		
		// LEANTWEEN INITIALIZATION
		LeanTween.init(3200); // This line is optional. Here you can specify the maximum number of tweens you will use (the default is 400).  This must be called before any use of LeanTween is made for it to be effective.
		#endif

		// Keep Original position and scale
		m_MoveOriginal = transform.position;
		m_ScaleOriginal = transform.localScale;
		m_FadeOriginal = 1.0f;

		m_Image = this.gameObject.GetComponent<Image>();
		m_Toggle = this.gameObject.GetComponent<Toggle>();
		m_Text = this.gameObject.GetComponent<Text>();
		m_RawImage = this.gameObject.GetComponent<RawImage>();
		m_Slider = this.gameObject.GetComponent<Slider>();
		m_CanvasRenderer = this.gameObject.GetComponent<CanvasRenderer>();
		
		// Set begin alpha
		if(this.gameObject.GetComponent<Renderer>()!=null)
		{
			if(m_Image)
			{
				m_FadeOriginal = m_Image.color.a;
			}
			if(m_Toggle)
			{
				m_FadeOriginal = m_Toggle.GetComponentInChildren<Image>().color.a;
			}
			if(m_Text)
			{
				m_FadeOriginal = m_Text.color.a;
			}
			if(m_RawImage)
			{
				m_FadeOriginal = m_RawImage.color.a;
			}
			if(m_Slider)
			{
				m_FadeOriginal = m_Slider.colors.normalColor.a;
			}
		}
	}
开发者ID:dallinnguyen,项目名称:Pokemon,代码行数:58,代码来源:GEAnim.cs

示例6: SetupAlgorithmToggle

 private void SetupAlgorithmToggle(Toggle toggle, MazeGenerator.Algorithm algorithm)
 {
     toggle.isOn = algorithm == generatorAlgorithm;
     toggle.name = algorithm.ToString();
     toggle.GetComponentInChildren<Text>().text = algorithmToString[algorithm];
     toggle.onValueChanged.AddListener(isOn =>
     {
         if (isOn)
         {
             generatorAlgorithm = algorithm;
         }
     });
 }
开发者ID:Mikevin,项目名称:ProceduralToolkit,代码行数:13,代码来源:MazeGeneratorUI.cs


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