How to toggle a UIContainer (show or hide)
Example
A UIContainer can be toggled between show and hide, from code, if you have a reference to it. Below is a code example on how to do it.
using Doozy.Runtime.UIManager.Containers;
using UnityEngine;
namespace Sandbox
{
public class TestClass : MonoBehaviour
{
public UIContainer MyContainer;
private void OnEnable()
{
// Animated Toggle
// If Visible or IsShowing calls Hide.
// If Hidden or IsHiding calls Show.
MyContainer.Toggle();
//or
// Instant Toggle (no animation)
// If Visible or IsShowing calls InstantHide.
// If Hidden or IsHiding calls InstantShow.
MyContainer.InstantToggle();
}
}
}
Code language: PHP (php)