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


C# Slider类代码示例

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


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

示例1: addSlider

    public void addSlider(Slider resourceSlider)
    {

        slider = resourceSlider;
        if(slider != null)
            slider.value = _value / _max;
    }
开发者ID:Desocrit,项目名称:BoDCode,代码行数:7,代码来源:Resource.cs

示例2: EnemyAttack

    void EnemyAttack()
    {
        if (tw.ce.enemySummoned) {
            if (whoMoves == 1) {
                Debug.Log("enemy atck");
                txt = damageTakenPlayer.GetComponent<Text>();
                dice = Random.Range(1, 9);
                if (dice + tw.ce.enemyLUK > tw.tst.dexTotal) {
                    dice = Random.Range(1, 5);
                    dmg = dice + tw.ce.enemySTR - ((tw.tst.conTotal / 4) * 3);
                    sld = playerLife.GetComponent<Slider>();
                    sld.value -= dmg;
                    txt.text = dmg.ToString();
                    lastDamage = dmg;
                    dmg = 0;
                    whoMoves = 0;
                } else {
                    txt.text = "MISS";
                    whoMoves = 0;
                }

                secondDamage.SetActive(false);
                damageTakenEnemy.SetActive(false);
                damageTakenPlayer.SetActive(true);
                healTaken.SetActive(false);
            }
        }
        turn++;
    }
开发者ID:danielkropf,项目名称:The-RPG,代码行数:29,代码来源:Battle.cs

示例3: EnemyAttack

    void EnemyAttack()
    {
        if (tw.ce.enemySummoned) {
            if (whoMoves == 1) {
                txt = damageTakenPlayer.GetComponent<Text>();
                dice = Random.Range(1, 21);
                diceDef = Random.Range(1, 5);
                if (dice > (tw.tst.dexTotal + diceDef)) {
                    dice = Random.Range(1, 5);
                    dmg = dice + tw.ce.enemySTR - (tw.tst.conTotal / 2);
                    sld = playerLife.GetComponent<Slider>();
                    sld.value -= dmg;
                    txt.text = dmg.ToString();
                    dmg = 0;
                    whoMoves = 0;
                } else {
                    txt.text = "MISS";
                    whoMoves = 0;
                }

                damageTakenEnemy.SetActive(false);
                damageTakenPlayer.SetActive(true);
            }
        }
    }
开发者ID:danielkropf,项目名称:The-RPG,代码行数:25,代码来源:Battle.cs

示例4: Start

	// Use this for initialization
	void Start () {
		 circles = GetComponentsInChildren<Circle>();
		 inputField = GameObject.Find("Canvas/InputField").GetComponent<InputField>();
		 stressBar = GameObject.Find("Canvas/Stress").GetComponent<Slider>();
		 audios = GetComponents<AudioSource>();

		 blackBackground = GameObject.Find("Canvas/BlackBackground");
		 gameOver = GameObject.Find("Canvas/BlackBackground/GameOver");
		 pressEnter = GameObject.Find("Canvas/BlackBackground/PressEnter");
		 gameStart = GameObject.Find("Canvas/BlackBackground/GameStart");
		 healthIndicator = GameObject.Find("Canvas/HealthIndicator").GetComponent<HealthIndicator>();

		 gameOver.SetActive(false);
		 isGameOver = true;
		 healthIndicator.SetTransparency(0f);

		 currentDay = 0;
		 taskIndex = 0;
		 dayTimer = new Timer(30f);
		 endOfDayTimer = new Timer(4f);
		 dayTimer.Reset();
		 taskTimer = new Timer(StepTimeBasedOnDay);
		 prevRandTask = 0;

		 daysData = CSVParser.Parse("Data/days");
	}
开发者ID:fdu5526,项目名称:CTIN492_FoundText,代码行数:27,代码来源:CirclesManager.cs

示例5: Awake

	protected override void Awake()
	{
		base.Awake();

        slider = GetComponent<Slider>();
		slider.value = 1f;
	}
开发者ID:sigmadruid,项目名称:NewMaze,代码行数:7,代码来源:BarItem.cs

示例6: Main

        public static void Main()
        {
            Window controllerWindow =
                GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.ControllerWindow));

            GlideTouch.Initialize();
            Glide.FitToScreen = true;

            Glide.MainWindow = controllerWindow;

            DirectionSlider = (Slider) controllerWindow.GetChildByName("DirectionSlider");
            DirectionSlider.ValueChangedEvent += UpdateRobotDirection;

            SpeedSlider = (Slider) controllerWindow.GetChildByName("SpeedSlider");
            SpeedSlider.ValueChangedEvent += UpdateRobotSpeed;

            var beepButton = (Button) controllerWindow.GetChildByName("BeepButton");
            beepButton.TapEvent += Beep;

            var stopButton = (Button) controllerWindow.GetChildByName("StopButton");
            stopButton.TapEvent += StopRobot;

            NrfController.OnDataReceived += HandleObstacleDetection;
            NrfController.Initialize("CONTR", "ROBOT");

            Thread.Sleep(Timeout.Infinite);
        }
开发者ID:jsikorski,项目名称:Remote-Controlled-Robot,代码行数:27,代码来源:Program.cs

示例7: Initialize

    public void Initialize()
    {
        Debug.Log("Initializing ControllerState");
        Screen.orientation = ScreenOrientation.LandscapeLeft;

        _backBtn = GameObject.Find(BackButton).GetComponent<Button>();
        _backBtn.onClick.AddListener(() => OnBackClick(_backBtn));

        _leftSlider = GameObject.Find(LeftSlider).GetComponent<Slider>();
        _leftSlider.value = 0;
        _leftSlider.onValueChanged.AddListener(OnLeftSliderChange);

        _rightSlider = GameObject.Find(RightSlider).GetComponent<Slider>();
        _rightSlider.value = 0;
        _rightSlider.onValueChanged.AddListener(OnRightSliderChange);

        _connected = false;
        _connecting = false;
        _zegg = _manager.GetSelectedZegg();
        if (_zegg == null) {
            Application.LoadLevel(Scenes.SCANNER);
            return;
        }

        ConnectToZegg(_zegg.Address);
    }
开发者ID:jerrytron,项目名称:pfp-zig-zegg,代码行数:26,代码来源:ControllerState.cs

示例8: Start

 // Use this for initialization
 void Start()
 {
     if (shakeSlider == null)
     {
         shakeSlider = gameObject.GetComponent<Slider>();
     }
 }
开发者ID:ironpencil,项目名称:critomit,代码行数:8,代码来源:ScreenShakeAdjuster.cs

示例9: Start

 // Use this for initialization
 void Start()
 {
     sound = GetComponent<AudioSource>();
     mAnimator = GetComponent<Animator>();
     // スライダーを取得する
     slider = GameObject.Find("Slider").GetComponent<Slider>();
 }
开发者ID:306-san,项目名称:brave_cat,代码行数:8,代码来源:Player_ito2.cs

示例10: Start

 void Start()
 {
     base.Init ();
     healthSlider = HealthBar.GetComponent<Slider> ();
     healthSlider.maxValue = maxHealth;
     healthSlider.value = maxHealth;
 }
开发者ID:Multihuntr,项目名称:random-game,代码行数:7,代码来源:PlayerHealth.cs

示例11: Start

	protected override void Start()
	{
		base.Start();
		textElement = GetComponentInChildren<Text>();
		layoutElement = GetComponent<LayoutElement>();
		slider = GameObject.Find("ButtonTextSlider").GetComponent<Slider>();
	}
开发者ID:Archimagus,项目名称:ggj2016,代码行数:7,代码来源:ChoiceButton.cs

示例12: Awake

    void Awake()
    {
		
        ground = GameObject.Find("Ground");
        chargeBar = GameObject.Find("Chargebar").GetComponent<Slider>();
        energyBar = GameObject.Find("EnergyBar").GetComponent<Slider>();
    }
开发者ID:hossamshuk,项目名称:SandWitch-Hunt,代码行数:7,代码来源:NetworkSphereAttack.cs

示例13: Start

    void Start()
    {
        if (_slider == null)
            _slider = (SliderProxy.FrameworkControl as Slider) ?? (SliderProxy.FrameworkControl as SliderDialog).Slider;

        if (_slider != null)
        {
            // Add slider with a tick for each configuration.

            if (Configurations != null)
            {
                var ticks = new Slider.Tick[Configurations.Length];
                for (int i = 0; i < ticks.Length; ++i)
                {
                    ticks[i] = new Slider.Tick();
                    ticks[i].Value = (float)i / (float)Configurations.Length;
                    ticks[i].Label = (i + 1).ToString();
                }
                _slider.Ticks = ticks;
                _slider.SnapsToTicks = true;

                _slider.InitialValue = (float)InitialValue / ticks.Length;
            }

            _slider.Moved += OnSliderMoved;
        }
    }
开发者ID:jacthoma,项目名称:Project-Elephant,代码行数:27,代码来源:ZSUConfigurationSelector.cs

示例14: Start

    void Start()
    {
        camera = Camera.main.transform;
        unit = GetComponentInParent<ClashBattleUnit>();
        slider = GetComponentInChildren<Slider>();

        var colors = new ColorBlock();
        switch (unit.species.type) {
            case ClashSpecies.SpeciesType.CARNIVORE:
                colors.normalColor = Color.red;
                break;
            case ClashSpecies.SpeciesType.HERBIVORE:
                colors.normalColor = Color.blue;
                break;
            case ClashSpecies.SpeciesType.OMNIVORE:
                colors.normalColor = Color.yellow;
                break;
            case ClashSpecies.SpeciesType.PLANT:
                colors.normalColor = Color.green;
                break;
            default: break;
        }
        colors.colorMultiplier = 1.0f;
        slider.colors = colors;
    }
开发者ID:hunvil,项目名称:ConvergeGame_Client,代码行数:25,代码来源:ClashHealthBar.cs

示例15: Init

        internal bool Init()
        {
            //buttons
            Button[] buttons = new Button[ 2 ];
            buttons[ 0 ] = new Button( JoystickButtons.Button1, 0 );
            buttons[ 1 ] = new Button( JoystickButtons.Button2, 1 );

            //axes
            Axis[] axes = new Axis[ 1 ];
            axes[ 0 ] = new JoystickInputDevice.Axis( JoystickAxes.X, new Range( -1, 1 ), false );

            //povs
            POV[] povs = new POV[ 0 ];
            //povs[ 0 ] = new JoystickInputDevice.POV( JoystickPOVs.POV1 );

            //sliders
            Slider[] sliders = new Slider[ 0 ];
            //sliders[ 0 ] = new Slider( JoystickSliders.Slider1 );

            //forceFeedbackController
            ForceFeedbackController forceFeedbackController = null;

            //initialize data
            InitDeviceData( buttons, axes, povs, sliders, forceFeedbackController );

            return true;
        }
开发者ID:huytd,项目名称:fosproject,代码行数:27,代码来源:ExampleCustomInputDevice.cs


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