Skip to content

Commit

Permalink
refine code
Browse files Browse the repository at this point in the history
  • Loading branch information
knoxHuang committed Jul 13, 2023
1 parent ed16ede commit 3c78df4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cocos/physics/framework/components/rigid-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
visible,
type,
serializable,
override,
} from 'cc.decorator';
import { DEBUG, EDITOR } from 'internal:constants';
import { Vec3, error, warn, CCClass } from '../../../core';
Expand Down Expand Up @@ -68,6 +69,12 @@ export class RigidBody extends Component {

/// PUBLIC PROPERTY GETTER\SETTER ///

@override
@visible(false)
get enabled() {
return this._enabled;
}

/**
* @en
* Gets or sets the group of the rigid body.
Expand Down Expand Up @@ -686,10 +693,6 @@ export class RigidBody extends Component {
}
}

if (EDITOR) {
CCClass.Attr.setClassAttr(RigidBody, 'enabled', 'visible', false);
}

function isDynamicBody (this: RigidBody): boolean { return this.isDynamic; }

export namespace RigidBody {
Expand Down

0 comments on commit 3c78df4

Please sign in to comment.