editor icon indicating copy to clipboard operation
editor copied to clipboard

Attributes categories

Open Ciberusps opened this issue 3 years ago • 0 comments

Its will be awesome to have opportunity to categorise attributes. In Unreal/Unity we have 2 different implementations

  • Unity - using decorators like Header and Space image

  • Unreal - using macro UPROPERTY(Category) works like collapsable list, list depth depends on split symbols “|” image

So in playcanvas editor attributes categorisation feature missing, will be awesome to have any, its can be implemented like this:

  • unreal-like - add new arg category to attributes.add()
TestScript.attributes.add("va1", { type: "string", category: "Character | Movement" });
  • unity-like - add new functions
    • attributes.header("My Header")
    • attributes.space(20) imho easier to implement and display in editor
const TestScript = pc.createScript("testScript");

TestScript.attributes.header("Some category name", { type: "string" });
TestScript.attributes.add("va1", { type: "string" });
TestScript.attributes.space(20);

TestScript.attributes.header("Some category name 2", { type: "string" });

Related: #774

Ciberusps avatar Aug 09 '22 09:08 Ciberusps