DebugConsoleToggleBehaviour.cs 374 B

12345678910111213141516171819
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class DebugConsoleToggleBehaviour : MonoBehaviour
  7. {
  8. private Toggle m_Toggle;
  9. void Awake()
  10. {
  11. m_Toggle = GetComponent<Toggle>();
  12. }
  13. private void OnEnable()
  14. {
  15. m_Toggle.isOn = DebugConsole.Instance.isShown;
  16. }
  17. }