Unity3D:Button保持状态

实现三个Button,三选一,其中一个选中状态,其他的normal状态。奇怪的解决方式。

参考链接:http://stackoverflow.com/questions/33770698/unity-5-ngui-highlighted-sprite-button-script-issue

Unity3D:Button保持状态_第1张图片

    private void setUI_bottom(EN_PRINT_QUALITY printQuality){
        switch (printQuality) {
        case EN_PRINT_QUALITY.HIGH_SPEED:
            btn_highSpeed.interactable = false;
            btn_standard.interactable = true;
            btn_highQuality.interactable = true;
            break;
        case EN_PRINT_QUALITY.STANDARD:
            btn_highSpeed.interactable = true;
            btn_standard.interactable = false;
            btn_highQuality.interactable = true;
            break;
        case EN_PRINT_QUALITY.HIGH_QUALITY:
            btn_highSpeed.interactable = true;
            btn_standard.interactable = true;
            btn_highQuality.interactable = false;
            break;
        }
    }

Unity3D:Button保持状态_第2张图片

转载于:https://www.cnblogs.com/makebetter/p/6758031.html

你可能感兴趣的:(Unity3D:Button保持状态)