playcanvas / playcanvas/editor
Be able to reference a pc.Script or Component directly in the Editor via Script Attributes
Open
Nobody has claimed this yet.
area: scripts
enhancement
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 215
- Avg merge
- 1d 29m
- Merged PRs (30d)
- 30
Description
Currently, users have to do the following:
SomeScript.attributes.add('someEntity', {type:'entity'});
SomeScript.prototype.initialize = function () {
this.someOtherScript = someEntity.script.someOtherScript;
};
Which is a little tedious. Maybe we could have some other property on the attribute that attempts to get a property on the referenced Entity and does some post processing before initialize? E.g
SomeScript.attributes.add('someOtherScript', {type:'entity', property: 'script.someOtherScript'});
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation file or test is named. Start by locating the Script Attributes handling and entity-reference resolution, then determine how a property such as script.someOtherScript could be resolved before initialize; done means an attribute can directly provide the referenced component without the manual lookup shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100