playcanvas / playcanvas/editor

Be able to reference a pc.Script or Component directly in the Editor via Script Attributes

Open
#199 0 comments 2 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.