1
0
mirror of synced 2024-12-18 09:15:54 +01:00
WACVR/Assets/Script/Configuration/VisibilityManager.cs

20 lines
502 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VisibilityManager : MonoBehaviour
{
public string ConfigKeyName;
void Start()
{
ConfigManager.onConfigChanged += ApplyConfig;
ConfigManager.EnsureInitialization();
ApplyConfig();
}
void ApplyConfig()
{
bool state = (bool)ConfigManager.config.GetType().GetField(ConfigKeyName).GetValue(ConfigManager.config);
gameObject.SetActive(state);
}
}