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

20 lines
502 B
C#
Raw Normal View History

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);
}
}