Skip to content

🔵 Prefab Library additions #24

@youarereadingthis

Description

@youarereadingthis

What do you have to say?

Some more utility methods to add to the PrefabLibrary static class.

Technical

  • A smart cache that stores properties of the specific prefab only on demand.
  • Each static method should have generic and Type argument support.
  • Each static method should have an extension method.

Methods

  • Get a property of a component from a path or PrefabFile.
    Example: Prefabs.GetValue<Weapon, string>( "WeaponName" )
  • Get a paired set of the first component on every prefab with a specific attribute.
    Usage: Listing/detailing gamemodes, settings, modules.
    Example: IEnumerable<(TComp, TAttribute)> Prefabs.FindComponentsWithAttribute<TComp, TAttribute>();
  • Get a tuple of every prefab and component with a specific attribute.
    Usage: Both displaying info on and spawning module prefabs directly.
    Example: IEnumerable<(PrefabFile, TComp, TAttribute)> = Prefabs.FindPrefabsWithAttribute<TAttribute>();

Documentation

  • Write up this shit so non-wizards know what's up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for Programming.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions