cocos / cocos/cocos-engine

希望给 Sprite 组件增加一个 可被子类覆盖的 getAssembler() 方法

Open
#19,082 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Needs Triage
Dominant language
C++
Stars
9.8k
Forks
2.1k
Avg merge
12h 42m
Merged PRs (30d)
13

Description

Use Case

例如:

   getAssembler (): IAssembler {
        return  Sprite.Assembler.getAssembler(this);
    }

    protected _flushAssembler (): void {
        const self = this;
        const assembler = this.getAssembler();

        if (self._assembler !== assembler) {
            self.destroyRenderData();
            self._assembler = assembler;
        }
        // ......
    }

有了这个方法后, 开发者就可以在自己的项目里 继承Sprite, 并使用自己的 Assembler .

Problem Description

.

Proposed Solution

No response

How it works

No response

Alternatives Considered

.

Additional Information

No response

Contributor guide

No contributing guide indexed for this repository

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

Start by locating the Sprite component and its _flushAssembler method, then inspect Sprite.Assembler.getAssembler(this) and the IAssembler type shown in the issue. Confirm how subclasses could provide a custom Assembler without breaking existing behavior. Done means Sprite exposes an overridable getAssembler() method and the existing assembler flow continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
game-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.