32 lines
574 B
C#
32 lines
574 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class BTN_OptionsMultiplayerAvatars : MonoBehaviour
|
|
{
|
|
[HideInInspector]
|
|
public Toggle toggle;
|
|
|
|
private PlayerSettingsMy playerSettings;
|
|
|
|
private void OnEnable()
|
|
{
|
|
if (toggle == null)
|
|
{
|
|
toggle = GetComponent<Toggle>();
|
|
}
|
|
if ((bool)GlobalSettings.Instance)
|
|
{
|
|
playerSettings = GlobalSettings.Instance.playerSettings;
|
|
toggle.isOn = playerSettings.showMultiplayerAvatars;
|
|
}
|
|
}
|
|
|
|
public void ValueChanged()
|
|
{
|
|
if ((bool)playerSettings)
|
|
{
|
|
playerSettings.SetMultiplayerAvatars(toggle.isOn);
|
|
}
|
|
}
|
|
}
|