mirror of
https://github.com/galacean/engine.git
synced 2026-05-31 07:42:01 +08:00
Fix compile error (#1465)
* build: fix compile error * feat: rename `OASIS_materials_remap` extension to `GALACEAN_materials_remap`
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { BufferUsage } from "./enums/BufferUsage";
|
||||
import { VertexElementFormat } from "./enums/VertexElementFormat";
|
||||
import { DataType } from "../base/Constant";
|
||||
import { BufferUsage } from "./enums/BufferUsage";
|
||||
import { IndexFormat } from "./enums/IndexFormat";
|
||||
import { VertexElementFormat } from "./enums/VertexElementFormat";
|
||||
|
||||
export interface ElementInfo {
|
||||
size: number;
|
||||
@@ -21,7 +21,7 @@ export class BufferUtil {
|
||||
}
|
||||
}
|
||||
|
||||
static _getGLIndexByteCount(indexFormat: IndexFormat): DataType {
|
||||
static _getGLIndexByteCount(indexFormat: IndexFormat): number {
|
||||
switch (indexFormat) {
|
||||
case IndexFormat.UInt8:
|
||||
return 1;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Material } from "@galacean/engine-core";
|
||||
import { registerGLTFExtension } from "../parser/GLTFParser";
|
||||
import { GLTFParserContext } from "../parser/GLTFParserContext";
|
||||
import { GLTFExtensionMode, GLTFExtensionParser } from "./GLTFExtensionParser";
|
||||
import { IGalaceanMaterialRemap } from "./GLTFExtensionSchema";
|
||||
|
||||
@registerGLTFExtension("GALACEAN_materials_remap", GLTFExtensionMode.CreateAndParse)
|
||||
class GALACEAN_materials_remap extends GLTFExtensionParser {
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
createAndParse(context: GLTFParserContext, schema: IGalaceanMaterialRemap): Promise<Material> {
|
||||
const { engine } = context.glTFResource;
|
||||
// @ts-ignore
|
||||
return engine.resourceManager.getResourceByRef<Material>(schema);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import { GLTFParserContext } from "../parser/GLTFParserContext";
|
||||
import { GLTFExtensionMode, GLTFExtensionParser } from "./GLTFExtensionParser";
|
||||
import { IGalaceanMaterialRemap } from "./GLTFExtensionSchema";
|
||||
|
||||
@registerGLTFExtension("OASIS_materials_remap", GLTFExtensionMode.CreateAndParse)
|
||||
class GalaceanMaterialsRemap extends GLTFExtensionParser {
|
||||
@registerGLTFExtension("GALACEAN_materials_remap", GLTFExtensionMode.CreateAndParse)
|
||||
class GALACEAN_materials_remap extends GLTFExtensionParser {
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@galacean/engine-tests",
|
||||
"private": true,
|
||||
"version": "0.9.0-alpha.4",
|
||||
"version": "1.0.0-alpha.6",
|
||||
"license": "MIT",
|
||||
"main": "dist/main.js",
|
||||
"module": "dist/module.js",
|
||||
|
||||
Reference in New Issue
Block a user