[add] first
This commit is contained in:
12
assets/src/utils.meta
Normal file
12
assets/src/utils.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "afa552d5-0d87-496e-8007-9f92f938a9f5",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"compressionType": {},
|
||||
"isRemoteBundle": {}
|
||||
}
|
||||
}
|
||||
21
assets/src/utils/disable-update-ubo.ts
Normal file
21
assets/src/utils/disable-update-ubo.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { _decorator, Component, Node, MeshRenderer } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('disable_update_ubo')
|
||||
export class disable_update_ubo extends Component {
|
||||
start () {
|
||||
setTimeout(() => {
|
||||
let mrs = this.getComponentsInChildren(MeshRenderer);
|
||||
mrs.forEach(mr => {
|
||||
// mr.model.updateUBOs(0);
|
||||
let origin = mr.model.updateUBOs;
|
||||
mr.model.updateUBOs = function () {
|
||||
if (!this._localDataUpdated) return;
|
||||
origin.call(this)
|
||||
}
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
assets/src/utils/disable-update-ubo.ts.meta
Normal file
9
assets/src/utils/disable-update-ubo.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "1aee80ed-71a1-4c04-b470-7693bd3ae1d9",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
33
assets/src/utils/switch-probe.ts
Normal file
33
assets/src/utils/switch-probe.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Component, director, MeshRenderer, ReflectionProbeType, _decorator } from "cc";
|
||||
|
||||
const { ccclass, executeInEditMode, property } = _decorator;
|
||||
|
||||
@ccclass('SwitchProbe')
|
||||
@executeInEditMode
|
||||
export class SwitchProbe extends Component {
|
||||
@property
|
||||
_useProbe = true;
|
||||
@property
|
||||
get useProbe () {
|
||||
return this._useProbe;
|
||||
}
|
||||
set useProbe (v) {
|
||||
this._useProbe = v;
|
||||
|
||||
let children = this.node.children;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
children[i].getComponents
|
||||
}
|
||||
|
||||
let mrs = this.node.getComponentsInChildren(MeshRenderer);
|
||||
mrs.forEach(mr => {
|
||||
if (v) {
|
||||
mr.reflectionProbe = ReflectionProbeType.BAKED_CUBEMAP;
|
||||
}
|
||||
else {
|
||||
mr.reflectionProbe = ReflectionProbeType.NONE;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
9
assets/src/utils/switch-probe.ts.meta
Normal file
9
assets/src/utils/switch-probe.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "fd67a8ab-3c25-4cf2-9e95-4ebac8dcef52",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user