using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Sirenix.OdinInspector; using KairoEngine.UI.InteractionHandler; [HideMonoScript] public class EncyclopediaUi : MonoBehaviour, IClickHandler { public EncyclopediaController controller; public GameObject menuGameObject; public GameObject subMenuGameObject; public GameObject viewsGameObject; public Transform menuContainer; public Transform subMenuContainer; public bool showDebug = false; public List views; private void Start() { if(menuGameObject == null) Debug.LogError("Missing Menu GameObject in EncyclopediaUi", this.gameObject); if(subMenuGameObject == null) Debug.LogError("Missing submenu GameObject in EncyclopediaUi", this.gameObject); if(viewsGameObject == null) Debug.LogError("Missing views GameObject in EncyclopediaUi", this.gameObject); } private void Update() { } [Button("Show Submenu"), ButtonGroup("EditorActions")] public void ShowSubmenu() => subMenuGameObject.SetActive(true); [Button("Hide Submenu"), ButtonGroup("EditorActions")] public void HideSubmenu() => subMenuGameObject.SetActive(false); public void Populate() { if(controller == null || menuContainer == null) return; Button[] oldButtons = menuContainer.GetComponentsInChildren