Inventory Pro

UIWindow


UIWindows are used a lot throughout Inventory Pro, this component handles the showing and hiding of any window and fires event when it does so.

Actions


public void Awake()
{
    var window = GetComponent(); // Grab the UIWindow component that we want to use.
    
    // Common UIWindow actions 
    window.Show();
    window.Hide();
    window.Toggle();
}

You can add your own actions whenever a window is shown or hidden. For example, whenever the inventory is closed you want to show a message.

Events


public void Awake()
{
    var window = GetComponent(); // Grab the UIWindow component that we want to use.
    
    // Register the hide event
    window.OnHide += () =>
    {
        // Window hidden
        
    };
    
    // Register the show event
    window.OnShow += () =>
    {
        // Window shown
        
    };
}