public Script_UIManager() { //Create character panel Canvas = GameObject.Find("Canvas"); CharacterPanel = GameObject.Instantiate(Resources.Load <Script_CharacterPanel>("Prefabs/UI/CharacterPanel")); CharacterPanel.Initialise(); CharacterPanel.transform.SetParent(Canvas.transform); CharacterPanel.transform.localPosition = Vector3.zero; CharacterPanel.Refresh(); CharacterPanel.Hide(); //Create inventory panel InventoryPanel = GameObject.Instantiate(Resources.Load <Script_InventoryPanel>("Prefabs/UI/InventoryPanel")); InventoryPanel.Initialise(); InventoryPanel.transform.SetParent(Canvas.transform); InventoryPanel.transform.localPosition = Vector3.zero; InventoryPanel.Refresh(); InventoryPanel.Hide(); //Create shop panel ShopPanel = GameObject.Instantiate(Resources.Load <Script_ShopPanel>("Prefabs/UI/ShopPanel")); ShopPanel.Initialise(); ShopPanel.transform.SetParent(Canvas.transform); ShopPanel.transform.localPosition = Vector3.zero; ShopPanel.Refresh(); ShopPanel.Hide(); }
private void ShowOnlyActivePanel() { // Debug.Log($"ShowOnlyActivePanel:{_activeWindow.Value}"); // Debug.Log($"CharacterPanel:{CharacterPanel}, BattlePanel:{BattlePanel},{BattlePanel.enabled},{BattlePanel.name}"); if (_activeWindow.Value == EnumMainWindow.Character) { CharacterPanel.Show(); } else { CharacterPanel.Hide(); } if (_activeWindow.Value == EnumMainWindow.Equip) { EquipmentPanel.Show(); } else { EquipmentPanel.Hide(); } if (_activeWindow.Value == EnumMainWindow.Battle) { BattlePanel.Show(); } else { BattlePanel.Hide(); } if (_activeWindow.Value == EnumMainWindow.Spells) { SpellsPanel.Show(); } else { SpellsPanel.Hide(); } if (_activeWindow.Value == EnumMainWindow.Talents) { TalentsPanel.Show(); } else { TalentsPanel.Hide(); } }