Is there any way we can create headers in property window like we do in Unity Editor?UnityHeader|347x457
Thanks for the reply. However I attached the script in a different project and I am getting the following warning: Failed to load inspector packages://property-enum/inspector/test/test.js for component “PropertyHeaders” . Also no properties are visible for the script.
Reference:https://docs.cocos2d-x.org/creator/manual/en/extension/extends-inspector.html
you do not copy the package folder to the different project?
What all should I copy to the other project?
This works perfectly. Just one more thing: How do I do this in typescript? Where I do write the editor: CC_EDITOR && {
inspector: “packages://property-enum/inspector/test/test.js”,
} part in Typescript?
reference:
const {ccclass, property, inspector} = cc._decorator;
@ccclass
@inspector("packages://property-enum/inspector/test/test.js")
export default class NewClass extends cc.Component {
@property
foo: string = "foo";
@property
bar: string = "bar";
@property
x: number = 200;
@property
y: number = 300;
}
you can find series api in creator.d.ts
eg:
I do not fully understand what you want to implement, pls tell me more, or you can give me a design sketch
For example, current provision as mentioned above only separates strings and nums.
I want to write custom headers like the one’s attached in the image. ( ‘TRUTH’ , ‘ALARMS’ )
using UnityEngine;
public class Example : MonoBehaviour
{
[Header("Health Settings")]
public int health = 0;
public int maxHealth = 100;
[Header("Shield Settings")]
public int shield = 0;
public int maxShield = 0;
}
Thanks for your reply. But I need to add headers dynamically for each script like this option in Unity. Cannot add every time to the test.html file if I need a new custom header.
not support yet.
Is there any way we can add this to feature request?
we are updating the editor to a new version. before it finished, no way to implement it
Okay thanks. When can we expect the new version?