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

浙公网安备 33010602011771号