Esempio n. 1
0
    private SliderBlock CreateBlock(float value, bool isVisible, float xPosition)
    {
        SliderBlock block = Instantiate(blockPrefab, transform);

        block.Parent    = Parent;
        block.ParentBar = this;
        block.value     = value;
        block.IsVisible = isVisible;
        block.GetComponent <RectTransform>().anchoredPosition = new Vector2(xPosition, 0f);
        return(block);
    }
Esempio n. 2
0
        public override void SafeAwake()
        {
            base.SafeAwake();

            lockToggle  = AddToggle("Lock", LanguageManager.Instance.CurrentLanguage.LockTarget, false);
            limitSlider = /*BB.*/ AddSlider(LanguageManager.Instance.CurrentLanguage.Limit, "Limit", /*Limit*/ 1f, 0f, 2f);
            //LimitSlider.ValueChanged += (float value) => { Limit = value; ChangedProperties(); };
            extendSlider = AddSlider(LanguageManager.Instance.CurrentLanguage.Extend, "Extend", 0f, 0f, limitSlider.Value);
            extendSlider.ValueChanged += extendValueChanged;
            HardnessMenu = /*BB.*/ AddMenu("Hardness", /*HardnessIndex*/ 1, LanguageManager.Instance.CurrentLanguage.WoodenHardness /*, false*/);
            //HardnessMenu.ValueChanged += (int value) => { HardnessIndex = value; ChangedProperties(); };

            sliderBlock = GetComponent <SliderBlock>();

#if DEBUG
            ConsoleController.ShowMessage("滑块添加进阶属性");
#endif
        }