unity UGUI中怎样让button一直保持在按下时状态直到点击另一个按钮


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class WeatherUI : MonoBehaviour
{

    [HideInInspector]
    public Button lastSelectWeather;
    // Start is called before the first frame update
    void Start()
    {
        
    }
    public void OnClickWeather(Button mybutton)
    {
        if (lastSelectWeather != null)
        {
            lastSelectWeather.enabled = true;
        }
        mybutton.enabled = false;
        lastSelectWeather = mybutton;
    }
}

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM