mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
lock skinned-mesh-renderer transform in editor (#12394)
* lock skinned-mesh-renderer transform in editor * set flags on node instead of component * set transform lock on component
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
import {
|
||||
ccclass, executeInEditMode, executionOrder, help, menu, tooltip, type,
|
||||
} from 'cc.decorator';
|
||||
import { EDITOR } from 'internal:constants';
|
||||
import type { AnimationClip } from '../../core/animation/animation-clip';
|
||||
import { Material } from '../../core/assets';
|
||||
import { Skeleton } from '../assets/skeleton';
|
||||
@@ -104,6 +105,9 @@ export class SkinnedMeshRenderer extends MeshRenderer {
|
||||
|
||||
public onLoad () {
|
||||
super.onLoad();
|
||||
if (EDITOR) {
|
||||
this._objFlags |= legacyCC.Object.Flags.IsPositionLocked | legacyCC.Object.Flags.IsRotationLocked | legacyCC.Object.Flags.IsScaleLocked;
|
||||
}
|
||||
this._tryBindAnimation();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user