Files
cocos-engine/tests/assets/material.test.ts
pandamicro 3240dba206 Component rename for new standard and 2d compatibility (#7103)
* Rename ui related components

* Rename files

* Remove Useless errors

* Fix sealed names

* Fix sealed global variables

* Fix circular reference

* Refactor more component names

* Rename particle and animation related component

* export scene and models sub module in renderer

* Rename ModelComponents to Model

* Refactor LightComponents to Light

* Refactor CameraComponent to Camera

* Refactor ConstraintComponents to Constraint and rename physics comps

* Cleanup and fix issues

* Small fixes

* Refactor Model to MeshRenderer

* Final touch

* Fix data class export

* Better deprecation to cover all old usage

* Simpler and better deprecation with js.setClassAlias

* Fix ci

* Fix editor issue
2020-09-02 15:31:49 +08:00

31 lines
1.0 KiB
TypeScript

import { Node } from '../../cocos/core/scene-graph/node';
import { MeshRenderer } from '../../cocos/core/3d/framework/model-component';
import { Material } from '../../cocos/core/assets/material';
import { strictEqual } from 'assert';
test('Material hash', () => {
});
// This doesn't work until we do `cc.game.init` properly (and perhaps headlessly) at start up
// test('Material hash', () => {
// const mat1 = new Material();
// const mat2 = new Material();
// mat1.initialize({ effectName: 'builtin-unlit' });
// mat2.initialize({ effectName: 'builtin-unlit', defines: { USE_TEXTURE: true } });
// const hash1 = mat1.hash;
// const hash2 = mat2.hash;
// const node = new Node();
// const comp = node.addComponent(MeshRenderer);
// comp.material = mat1;
// strictEqual(comp.material.hash, hash1);
// strictEqual(comp.sharedMaterial.hash, hash1);
// comp.material = mat2;
// strictEqual(comp.material.hash, hash2);
// strictEqual(comp.sharedMaterial.hash, hash2);
// });