Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cocos/scene-graph/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

const idGenerator = new js.IDGenerator('Node');

function getConstructor<T> (typeOrClassName: string | Constructor<T> | AbstractedConstructor<T>): Constructor<T> | AbstractedConstructor<T> | null | undefined {

Check warning on line 62 in cocos/scene-graph/node.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 160. Maximum allowed is 150
if (!typeOrClassName) {
errorID(3804);
return null;
Expand Down Expand Up @@ -316,7 +316,7 @@
return null;
}

protected static _findComponents<T extends Component> (node: Node, constructor: Constructor<T> | AbstractedConstructor<T>, components: Component[]): void {

Check warning on line 319 in cocos/scene-graph/node.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 159. Maximum allowed is 150
const cls = constructor;
const comps = node._components;
// NOTE: internal rtti property
Expand Down Expand Up @@ -2616,15 +2616,19 @@
* @param y Y axis position
* @param z Z axis position
*/
public setWorldPosition(x: number, y: number, z: number): void;
public setWorldPosition(x: number, y: number, z?: number): void;
Comment thread
star-e marked this conversation as resolved.

public setWorldPosition (val: Vec3 | number, y?: number, z?: number): void {
const worldPosition = this._pos;

if (y === undefined) {
Vec3.copy(worldPosition, val as Vec3);
} else {
Vec3.set(worldPosition, val as number, y, z!);
if (z === undefined) {
z = worldPosition.z;
}

Vec3.set(worldPosition, val as number, y, z);
}

const parent = this._parent;
Expand Down
Loading