Widget Library
Workflow
Widget Library app depends on its manager and widget items. You can manage the available widgets or create your own using the ‘Widget Manager’ component – which is attached to the app window. All widgets will be generated at runtime.
Creating A New Widget
You can add or create your own widgets easily! Here’s a step-by-step guide:
- Select one of the existing widget prefab (you can locate to DreamOS > Prefabs > Widgets).
- Duplicate the prefab, delete/change its content and rename it as you want.
- Add a new widget item using the ‘Widget Items’ list.
- Assign the prefab to the ‘Widget Prefab’ field.
That’s it! Your widget will be generated at runtime. If you want, you can tweak some settings.
Scripting
using UnityEngine;
using Michsky.DreamOS; // DreamOS namespace
public class SampleClass : MonoBehaviour
{
[SerializeField] private WidgetManager widgetApp; // App variable
void YourFunction()
{
// Enable widget by index
widgetApp.EnableWidget(1);
// Enable widget by id
widgetApp.EnableWidget("Widget ID");
// Disable widget by index
widgetApp.DisableWidget(1);
// Disable widget by id
widgetApp.DisableWidget("Widget ID");
}
}
How can we help?
A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.