Panel Manager
This component manages multiple panels, similar to the tab system.
Adding panels
In order to add a new panel, follow these steps:
- Select the panel manager object (e.g. Main Content in the demo scene) and add a new list item.
- Set an unique panel name, duplicate one of the existing panel object and assign the new object to the ‘Panel Object’ field.
- (Optional) Assign a button to the ‘Panel Button’ or ‘Alt Panel Button’ field.
Deleting panels
In order to delete an existing panel, follow these steps:
- Select the panel manager object (e.g. Main Content in the demo scene) and remove the list item.
- Delete any remaining objects such as panel and/or button objects.
Scripting
using UnityEngine;
using Michsky.UI.Beam; // Namespace
public class SampleClass : MonoBehaviour
{
[SerializeField] private PanelManager myPanels;
void Start()
{
// Open panel
myPanels.OpenPanel("Panel Name");
// Open panel by list index
myPanels.OpenPanelByIndex(1);
// Set the animation speed
myPanels.animationSpeed = 1;
// Add panel events
myPanels.onPanelChanged.AddListener(TestFunction);
}
void TestFunction(int index)
{
Debug.Log("Selected panel: " + myPanels.panels[index].panelName);
}
}
How can we help?
A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.