示例#1
0
        public void OnNPLevelSliderChanged(GameOptionSlider option)
        {
            if (option.slider != UISlider.current)
            {
                return;
            }

            float value = option.slider.value;
            bool  flag  = option.value != value;

            option.value = value;
            /*  */
            int    num = Mathf.CeilToInt(option.slider.value * (option.slider.numberOfSteps - 1));
            string s;

            switch (num)
            {
            case 1:
                s = "Lv1";
                break;

            case 2:
                s = "Lv2";
                break;

            case 3:
                s = "Lv3";
                break;

            default:
                s = "默认";
                break;
            }
            option.ValueTxtLabel.text = s;
        }
示例#2
0
        private void addSlider(string key, float defaultValue, string name, int numberOfSteps, string actionName)
        {
            EventDelegate    onChangeEvent = new EventDelegate(this, actionName);
            GameOptionSlider opSlider      = new GameOptionSlider(gameObject, key, defaultValue, onChangeEvent);

            opSlider.SetLocalPosition(0f, GetYAfterIncrement(opSlider), 0f);
            opSlider.slider.numberOfSteps = numberOfSteps;
            opSlider.NameTxtLabel.text    = name;
        }
示例#3
0
        public void OnAtkSliderChanged(GameOptionSlider option)
        {
            if (option.slider != UISlider.current)
            {
                return;
            }

            float value = option.slider.value;

            bool flag = option.value != value;

            option.value = value;

            int num = Mathf.CeilToInt(value * (option.slider.numberOfSteps - 1)) + 1;

            option.ValueTxtLabel.text = "x" + num;
        }