File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SetToggle : MonoBehaviour
{
public Toggle toggle;
public GameObject goTargetObject;
public PlayManager playManager;
public int toggleIndex;
// Start is called before the first frame update
void Start()
{
toggle.onValueChanged.AddListener(SetToggleButton);
SetToggleButton(toggle.isOn);
}
public void SetToggleButton(bool _value)
{
//Debug.Log(_value);
goTargetObject.SetActive(toggle.isOn);
if(toggle.isOn)
{
playManager.currentToggleIndex = toggleIndex;
Debug.Log(playManager.currentToggleIndex);
}
}
// Update is called once per frame
void Update()
{
}
}