示例#1
0
    private void Start()
    {
        this.transform.position = Vector3.zero;
        slider = GetComponentInChildren <Slider>();

        slider.maxValue = accuracy;
        slider.onValueChanged.AddListener(delegate { ScannerController.updateSliders(); });
        ScannerController.RegisterScannerSlider(this);

        string gameObjectName = gameObject.name.Remove(0, 6);

        BlockTypes.TryParse(gameObjectName, out BlockTypes result);
        blockType          = result;
        BlockTypeText.text = result.ToString();

        if (blockType == BlockTypes.DirtBlock)
        {
            slider.value = slider.maxValue;
        }

        UpgradeAccuracyButton.onClick.AddListener(upgradeScannerAccuracy);

        updatePercentageText();
    }