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;
    }
}

  

posted @ 2020-03-13 14:54  昭1122  阅读(4645)  评论(0编辑  收藏  举报