30 lines
548 B
C#
30 lines
548 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class LegBtn : MonoBehaviour
|
|
{
|
|
public Sprite on, off;
|
|
Image img;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
img = GetComponent<Image>();
|
|
}
|
|
|
|
public void changeSprite(bool b) {
|
|
if (!b)
|
|
{
|
|
img.sprite = on;
|
|
Debug.Log(" ta ON");
|
|
}
|
|
else
|
|
{
|
|
img.sprite = off;
|
|
Debug.Log(" ta off");
|
|
}
|
|
}
|
|
}
|