mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a6f83bd6d | |||
| 04f063eb2b | |||
| 910865bd8b | |||
| e384f54ed2 | |||
| 5964835c83 | |||
| f4ae16247c | |||
| 4b4a3ca13f | |||
| f1c5d21be6 | |||
| da75e89f4a | |||
| aba27a715d | |||
| 62c1eb58c3 |
@@ -160,7 +160,8 @@ class ClipMotionEval implements MotionEval {
|
||||
|
||||
public overrideClips (context: AnimationGraphBindingContext): void {
|
||||
const { _originalClip: originalClip } = this;
|
||||
const overriding = context.clipOverrides?.get(originalClip);
|
||||
const clipOverrides: any = context.clipOverrides;
|
||||
const overriding: AnimationClip | null = clipOverrides && clipOverrides.get ? clipOverrides.get(originalClip) : null;
|
||||
if (overriding) {
|
||||
this._setClip(overriding, context);
|
||||
}
|
||||
|
||||
+14
-12
@@ -33,16 +33,16 @@ const MAGIC = 0x4E4F4343;
|
||||
const CHUNK_ALIGN_AS = 8;
|
||||
|
||||
export class CCON {
|
||||
constructor (document: unknown, chunks: Uint8Array[]) {
|
||||
constructor(document: unknown, chunks: Uint8Array[]) {
|
||||
this._document = document;
|
||||
this._chunks = chunks;
|
||||
}
|
||||
|
||||
get document (): unknown {
|
||||
get document(): unknown {
|
||||
return this._document;
|
||||
}
|
||||
|
||||
get chunks (): Uint8Array[] {
|
||||
get chunks(): Uint8Array[] {
|
||||
return this._chunks;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ export class CCON {
|
||||
private declare _chunks: Uint8Array[];
|
||||
}
|
||||
|
||||
export function encodeCCONBinary (ccon: CCON): Uint8Array {
|
||||
export function encodeCCONBinary(ccon: CCON): Uint8Array {
|
||||
const { document, chunks } = ccon;
|
||||
|
||||
const jsonBytes = new Uint8Array(notepackEncode(document));
|
||||
@@ -75,7 +75,7 @@ export function encodeCCONBinary (ccon: CCON): Uint8Array {
|
||||
headerView.setUint32(8, ccobBuilder.byteLength, true);
|
||||
return ccobBuilder.get();
|
||||
|
||||
function uint32Bytes (value: number): ArrayBufferView {
|
||||
function uint32Bytes(value: number): ArrayBufferView {
|
||||
const bytes = new ArrayBuffer(4);
|
||||
const view = new DataView(bytes);
|
||||
view.setUint32(0, value, true);
|
||||
@@ -83,7 +83,7 @@ export function encodeCCONBinary (ccon: CCON): Uint8Array {
|
||||
}
|
||||
}
|
||||
|
||||
export function decodeCCONBinary (bytes: Uint8Array): CCON {
|
||||
export function decodeCCONBinary(bytes: Uint8Array): CCON {
|
||||
if (bytes.length < 16) {
|
||||
throw new InvalidCCONError(getError(13102));
|
||||
}
|
||||
@@ -159,7 +159,7 @@ interface BufferConstructor {
|
||||
from(buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): Buffer;
|
||||
}
|
||||
|
||||
function decodeJson (data: Uint8Array): string {
|
||||
function decodeJson(data: Uint8Array): string {
|
||||
if (typeof TextDecoder !== 'undefined') {
|
||||
return new TextDecoder().decode(data);
|
||||
} else if ('Buffer' in globalThis) {
|
||||
@@ -177,13 +177,13 @@ export class BufferBuilder {
|
||||
private _viewOrPaddings: (ArrayBufferView | number)[] = [];
|
||||
private _length = 0;
|
||||
|
||||
constructor () {}
|
||||
constructor() { }
|
||||
|
||||
get byteLength (): number {
|
||||
get byteLength(): number {
|
||||
return this._length;
|
||||
}
|
||||
|
||||
public alignAs (align: number): number {
|
||||
public alignAs(align: number): number {
|
||||
if (align !== 0) {
|
||||
const remainder = this._length % align;
|
||||
if (remainder !== 0) {
|
||||
@@ -196,14 +196,14 @@ export class BufferBuilder {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public append (view: ArrayBufferView): number {
|
||||
public append(view: ArrayBufferView): number {
|
||||
const result = this._length;
|
||||
this._viewOrPaddings.push(view);
|
||||
this._length += view.byteLength;
|
||||
return result;
|
||||
}
|
||||
|
||||
public get (): Uint8Array {
|
||||
public get(): Uint8Array {
|
||||
const result = new Uint8Array(this._length);
|
||||
let counter = 0;
|
||||
this._viewOrPaddings.forEach((viewOrPadding) => {
|
||||
@@ -219,4 +219,6 @@ export class BufferBuilder {
|
||||
}
|
||||
|
||||
cclegacy.internal.decodeCCONBinary = decodeCCONBinary;
|
||||
cclegacy.internal.encodeCCONBinary = encodeCCONBinary;
|
||||
cclegacy.internal.CCON = CCON;
|
||||
cclegacy.internal.BufferBuilder = BufferBuilder;
|
||||
|
||||
@@ -38,6 +38,11 @@ module.exports = {
|
||||
newCubeMap: 'CubeMap',
|
||||
newRenderTexture: 'Render Texture',
|
||||
newScene: 'Scene',
|
||||
newScene:{
|
||||
'2d': '2D',
|
||||
'3d': '3D',
|
||||
quality: 'Quality',
|
||||
},
|
||||
newPrefab: 'Node Prefab',
|
||||
newMaterial: 'Material',
|
||||
newPhysicsMaterial: 'Physics Material',
|
||||
|
||||
@@ -37,6 +37,11 @@ module.exports = {
|
||||
newTypeScript: '脚本 (TypeScript)',
|
||||
newCubeMap: '立方体贴图',
|
||||
newScene: '场景',
|
||||
newScene:{
|
||||
'2d': '2D',
|
||||
'3d': '3D',
|
||||
quality: '质量',
|
||||
},
|
||||
newPrefab: '预制 (Prefab)',
|
||||
newRenderTexture: '渲染纹理 (Render Texture)',
|
||||
newMaterial: '材质',
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "cocos-creator",
|
||||
"version": "4.0.0-alpha.10",
|
||||
"version": "4.0.0-alpha.15",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "cocos-creator",
|
||||
"version": "4.0.0-alpha.10",
|
||||
"version": "4.0.0-alpha.15",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cocos-creator",
|
||||
"version": "4.0.0-alpha.10",
|
||||
"version": "4.0.0-alpha.15",
|
||||
"description": "Cocos Creator is a cross-platform 2D & 3D game engine written in C++ and TypeScript, licensed under MIT.",
|
||||
"homepage": "http://www.cocos.com",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -124,6 +124,13 @@ minigame.createInnerAudioContext = createInnerAudioContextPolyfill(wx, {
|
||||
onSeek: false,
|
||||
}, true);
|
||||
|
||||
let _cachedSystemInfo: SystemInfo = wx.getWindowInfo();
|
||||
minigame.onWindowResize?.((): void => {
|
||||
// update cached system info
|
||||
_cachedSystemInfo = wx.getWindowInfo() as SystemInfo;
|
||||
});
|
||||
minigame.getWindowInfo = (): SystemInfo => _cachedSystemInfo;
|
||||
|
||||
// #region SafeArea
|
||||
// FIX_ME: wrong safe area when orientation is landscape left
|
||||
minigame.getSafeArea = (): SafeArea => {
|
||||
|
||||
Reference in New Issue
Block a user