Astra Child

How to show or hide UIView Category

Estimated reading: 1 minute 0 views

Example

The example below shows all the available show and hide options for a UIView category. This allows for showing and/or hiding all the views in the given category.

using Doozy.Runtime.UIManager.Containers;
using UnityEngine;
namespace Sandbox
{
    public class TestClass : MonoBehaviour
    {
        public string ViewCategory;

        private void OnEnable()
        {
            //SHOW all views in target category
            UIView.ShowCategory(ViewCategory);             // show category - ANIMATED
            UIView.ShowCategory(ViewCategory, true);       // show category - INSTANT
            UIView.Show(ViewCategory, string.Empty);       // show category - ANIMATED
            UIView.Show(ViewCategory, string.Empty, true); // show category - INSTANT


            //HIDE all views in target category
            UIView.HideCategory(ViewCategory);             // hide category - ANIMATED
            UIView.HideCategory(ViewCategory, true);       // hide category - INSTANT
            UIView.Hide(ViewCategory, string.Empty);       // hide category - ANIMATED
            UIView.Hide(ViewCategory, string.Empty, true); // hide category - INSTANT
        }
    }
}
Code language: PHP (php)
Share this Doc
CONTENTS
Scroll to Top