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


C# Slider.GetComponentsInChildren方法代码示例

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


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

示例1: Awake

 void Awake()
 {
     //POBIERAMY SLIDER
     sld = GetComponent<Slider>() ;
     //POBIERAMY WSZYSTKIE DZIEIC KTORE POSIADAJA COMPONENT Image
     img = sld.GetComponentsInChildren<Image>() ;
 }
开发者ID:HakerPL,项目名称:UNITY-Survival_Shooter,代码行数:7,代码来源:ChangeColorSlider.cs

示例2: Awake

  void Awake() {
    foreach (Text t in GetComponentsInChildren<Text>()) {
      if (t.gameObject.name == "curpos_text") {
        videoPosition = t;
      } else if (t.gameObject.name == "duration_text") {
        videoDuration = t;
      }
    }

    foreach (RawImage raw in GetComponentsInChildren<RawImage>(true)) {
      if (raw.gameObject.name == "playImage") {
        playSprite = raw.gameObject;
      } else if (raw.gameObject.name == "pauseImage") {
        pauseSprite = raw.gameObject;
      }
    }

    foreach (Slider s in GetComponentsInChildren<Slider>(true)) {
      if (s.gameObject.name == "video_slider") {
        videoScrubber = s;
        videoScrubber.maxValue = 100;
        videoScrubber.minValue = 0;
        foreach (Image i in videoScrubber.GetComponentsInChildren<Image>()) {
          if (i.gameObject.name == "BufferedBackground") {
            bufferedBackground = i.gameObject;
          }
        }
      } else if (s.gameObject.name == "volume_slider") {
        volumeSlider = s;
      }
    }

    foreach (RectTransform obj in GetComponentsInChildren<RectTransform>(true)) {
      if (obj.gameObject.name == "volume_widget") {
        volumeWidget = obj.gameObject;
      } else if (obj.gameObject.name == "settings_panel") {
        settingsPanel = obj.gameObject;
      }
    }
  }
开发者ID:MaTriXy,项目名称:cardboard-unity,代码行数:40,代码来源:VideoControlsManager.cs

示例3: InterpolateColour

 /// <summary>
 /// Gives a smooth colour to the slider
 /// </summary>
 /// <param name="slider">the slider to give a colour to</param>
 private void InterpolateColour(Slider slider)
 {
     Image fill = slider.GetComponentsInChildren<Image>().FirstOrDefault(t => t.name == Fill);
     fill.color = Color.Lerp(minHealthColor, maxHealthColor, slider.value/1);
 }
开发者ID:aaronbloom,项目名称:crowd-simulation,代码行数:9,代码来源:BoidInformationWindow.cs

示例4: Start

    // Use this for initialization
    protected new void Start()
    {
        model = Instantiate(modelPrefab, transform.position, transform.rotation) as Transform;
        model.SetParent(transform, true);
        guiCanvas = GameObject.Find ("HUD");
        base.Start();
        _state = EnemyPlaneState.STATE_PATROL;
        _healthBar = transform.Find("Health").GetComponent<Slider>();
        _healthBar.transform.SetParent(guiCanvas.transform);
        _healthFill = _healthBar.GetComponentsInChildren<UnityEngine.UI.Image>()
            .FirstOrDefault(t => t.name == "Fill");
        //TODO: Find front of colliders
        frontOfPlane = 9.76f;
        //TODO: Read the waypoints and start position from a file or the scene.
        _wayPoints = new List<Vector2>();
        addWayPoint(0.0f, 4.0f);
        addWayPoint(-1.0f, 5.0f);
        addWayPoint(-4.0f, 5.0f);
        addWayPoint(-5.0f, 4.0f);
        addWayPoint(-5.0f, 1.0f);
        addWayPoint(-4.0f, 0.0f);
        addWayPoint(2.0f, 0.0f);
        addWayPoint(3.0f, -1.0f);
        addWayPoint(3.0f, -2.0f);
        addWayPoint(2.0f, -3.0f);
        addWayPoint(1.0f, -3.0f);
        addWayPoint(0.0f, -2.0f);

        _player = GameObject.Find("PlayerPlane");
        if (_player != null)
        {
            _playerPlane = _player.GetComponent<PlayerPlaneScript>();
            _playerPlane.addEnemy(this);
            _arrow = transform.FindChild("Arrow").gameObject;
            _arrow.transform.SetParent(null);
        }
    }
开发者ID:natwalker,项目名称:dogfight,代码行数:38,代码来源:EnemyPlaneScript.cs


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