You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
562 B
27 lines
562 B
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
[RequireComponent(typeof(Toggle))] |
|
public class SetToggleImage : MonoBehaviour { |
|
|
|
private Toggle toggle; |
|
public Image image; |
|
// Use this for initialization |
|
void Start () |
|
{ |
|
toggle = GetComponent<Toggle>(); |
|
toggle.onValueChanged.AddListener(ValueChanged); |
|
} |
|
|
|
// Update is called once per frame |
|
void Update () { |
|
|
|
} |
|
private void ValueChanged(bool isOn) |
|
{ |
|
image.enabled = !isOn; |
|
} |
|
}
|
|
|