Skip to main content

GroupPermissionsEnabler

A class in Root.Township, Alta.Meta.UI.ServerManagement.

Main menu UI helper that shows or hides objects depending on whether you hold the given permissions in the group a SelectedGroupPanel is showing. Client only.

Constructors​

MemberWhat it is
GroupPermissionsEnabler()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private SelectedGroupPanel groupPanelThe selected group panel whose group is checked.
private ToggleUnityEvent hasPermissionsEventEvent invoked with true or false after each check.
private GroupPermissions[] permissionsThe group permissions you must hold for the objects to be shown.
private GameObject[] toEnableWithPermissionsObjects made active only when you hold the permissions.

Methods​

2 private and internal methods
MemberWhat it is
private void HandleGroupChange(SelectedGroupPanel obj)Checks your roles in the panel's group against permissions, toggles the objects and fires hasPermissionsEvent.
private void Start()Subscribes to the panel's GroupUpdated event and runs the check at once if a group is already set.