28 lines
582 B
C#
28 lines
582 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class youxiajiao : MonoBehaviour
|
|
{
|
|
[SerializeField] Button Btn;
|
|
[SerializeField] Image im;
|
|
int sum = 1;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
Btn.onClick.AddListener(() =>
|
|
{
|
|
if (sum%2!=0)
|
|
{
|
|
im.gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
im.gameObject.SetActive(false);
|
|
}
|
|
sum++;
|
|
});
|
|
}
|
|
}
|