VerticalLayoutGroupCanvasTypeSettings - jimdroberts/FishMMO GitHub Wiki
The VerticalLayoutGroupCanvasTypeSettings
class is a canvas type settings handler for Unity's VerticalLayoutGroup
component in the FishMMO client. It is designed to provide a hook for applying configuration-based settings to vertical layout groups, though no settings are currently applied by default.
-
public override void ApplySettings(object component, Configuration configuration)
Attempts to cast the component to
VerticalLayoutGroup
and apply settings from configuration. Currently, no settings are applied by default.
- Ensure
VerticalLayoutGroupCanvasTypeSettings
is registered in your canvas settings map forVerticalLayoutGroup
components. - Extend the class or modify
ApplySettings
to add custom layout settings as needed.
// Example usage in a canvas crawler or theming system:
var layoutGroup = myGameObject.GetComponent<VerticalLayoutGroup>();
var settings = new VerticalLayoutGroupCanvasTypeSettings();
settings.ApplySettings(layoutGroup, configuration);
- Use this class as a base for adding custom layout settings to vertical layout groups.
- Register this handler in your canvas settings map to enable future theming or layout adjustments.
- Validate component types in
ApplySettings
to avoid runtime errors. - Extend or override for custom layout behavior as your UI requirements evolve.