mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
fix particle and fbx interface bug (#15376)
* fix widget interface bug * fix fbx event-editor interface bug * revert particle-3d interface bug in inspector
This commit is contained in:
@@ -8,7 +8,7 @@ const defaultParams = {
|
||||
|
||||
exports.template = /* html */`
|
||||
<div @change.stop="onConfirm" v-if="event">
|
||||
<ui-section class="config" expand>
|
||||
<ui-section expand>
|
||||
<div slot="header" class="header" @click.stop>
|
||||
<ui-input name="funcName" placeholder="function Name"
|
||||
:value="event.func"
|
||||
|
||||
@@ -162,7 +162,7 @@ ui-icon {
|
||||
background: var(--color-normal-fill);
|
||||
}
|
||||
#event-editor {
|
||||
line-height: 24px;
|
||||
line-height: 20px;
|
||||
width: 100%;
|
||||
height: 70%;
|
||||
overflow: hidden;
|
||||
@@ -176,19 +176,19 @@ ui-icon {
|
||||
#event-editor > header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 24px;
|
||||
height: 20px;
|
||||
background: var(--color-normal-fill-emphasis);
|
||||
padding: 5px;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
#event-editor > .header .name {
|
||||
margin: 0 5px;
|
||||
margin: 0 4px;
|
||||
}
|
||||
#event-editor > .header .dirty {
|
||||
color: var(--color-focus-fill);
|
||||
margin: 0 2px;
|
||||
}
|
||||
#event-editor > .functions {
|
||||
padding: 10px;
|
||||
padding: 4px;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
@@ -200,7 +200,6 @@ ui-icon {
|
||||
#event-editor > .functions .line {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 8px;
|
||||
flex: 1;
|
||||
background: unset;
|
||||
}
|
||||
@@ -210,9 +209,6 @@ ui-icon {
|
||||
#event-editor > .functions .line .name {
|
||||
min-width: 8px;
|
||||
}
|
||||
#event-editor > .functions .line > * {
|
||||
margin-right: 5px;
|
||||
}
|
||||
#event-editor > .functions .line .operate {
|
||||
visibility: hidden;
|
||||
}
|
||||
@@ -222,19 +218,14 @@ ui-icon {
|
||||
#event-editor > .functions .header ui-input {
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
line-height: 18px;
|
||||
}
|
||||
#event-editor > .functions .header ui-input:hover {
|
||||
background-color: var(--color-normal-fill-emphasis);
|
||||
}
|
||||
#event-editor > .functions > * {
|
||||
margin-top: 10px;
|
||||
}
|
||||
#event-editor ui-input,
|
||||
#event-editor ui-checkbox,
|
||||
#event-editor ui-num-input {
|
||||
width: 100%;
|
||||
height: 25px;
|
||||
}
|
||||
#event-editor ui-section {
|
||||
width: 100%;
|
||||
@@ -245,11 +236,10 @@ ui-icon {
|
||||
}
|
||||
#event-editor .tools {
|
||||
display: flex;
|
||||
border-bottom: 1px solid;
|
||||
padding: 10px 0;
|
||||
padding: 4px 0;
|
||||
}
|
||||
#event-editor .tools ui-icon {
|
||||
margin: 0 5px;
|
||||
margin: 0 4px;
|
||||
}
|
||||
#event-editor .params {
|
||||
border: 1px rgba(136, 136, 136, 0.35) dashed;
|
||||
|
||||
@@ -36,7 +36,7 @@ exports.template = /* html*/`
|
||||
<!-- Render other data that has not taken over -->
|
||||
<div id="customProps"></div>
|
||||
|
||||
<ui-section class="config" key="renderCulling" autoExpand cache-expand="particle-system-cullingMode">
|
||||
<ui-section key="renderCulling" autoExpand cache-expand="particle-system-cullingMode">
|
||||
<ui-prop slot="header" no-label class="header" empty="true" labelflag="renderCulling" key="renderCulling">
|
||||
<ui-checkbox></ui-checkbox>
|
||||
<ui-label></ui-label>
|
||||
@@ -51,7 +51,7 @@ exports.template = /* html*/`
|
||||
</ui-prop>
|
||||
<ui-button id="resetBounds" style="width:200px;margin: 4px auto 0 auto;">Regenerate bounding box</ui-button>
|
||||
</ui-section>
|
||||
<ui-section class="config" key="noiseModule.value.enable" autoExpand cache-expand="particle-system-useNoise">
|
||||
<ui-section key="noiseModule.value.enable" autoExpand cache-expand="particle-system-useNoise">
|
||||
<ui-prop slot="header" no-label class="header" empty="true" key="noiseModule.value.enable">
|
||||
<ui-checkbox></ui-checkbox>
|
||||
<ui-label value="Noise Module"></ui-label>
|
||||
@@ -77,7 +77,7 @@ exports.template = /* html*/`
|
||||
<ui-prop type="dump" key="noiseModule.value.octaveMultiplier" disableflag="!noiseModule.value.enable"></ui-prop>
|
||||
<ui-prop type="dump" key="noiseModule.value.octaveScale" disableflag="!noiseModule.value.enable"></ui-prop>
|
||||
</ui-section>
|
||||
<ui-section class="config" key="shapeModule" cache-expand="particle-system-shapeModule">
|
||||
<ui-section key="shapeModule" cache-expand="particle-system-shapeModule">
|
||||
<ui-prop slot="header" no-label class="header" type="dump" key="shapeModule.value.enable" labelflag="shapeModule"
|
||||
empty="true">
|
||||
<ui-checkbox></ui-checkbox>
|
||||
@@ -105,9 +105,9 @@ exports.template = /* html*/`
|
||||
<ui-prop type="dump" key="shapeModule.value.sphericalDirectionAmount"></ui-prop>
|
||||
<ui-prop type="dump" key="shapeModule.value.randomPositionAmount"></ui-prop>
|
||||
</ui-section>
|
||||
<ui-section class="config" key="velocityOvertimeModule" autoflag="true" cache-expand="particle-system-velocityOvertimeModule"></ui-section>
|
||||
<ui-section class="config" key="forceOvertimeModule" autoflag="true" cache-expand="particle-system-forceOvertimeModule"></ui-section>
|
||||
<ui-section empty="true" class="config" key="sizeOvertimeModule"
|
||||
<ui-section key="velocityOvertimeModule" autoflag="true" cache-expand="particle-system-velocityOvertimeModule"></ui-section>
|
||||
<ui-section key="forceOvertimeModule" autoflag="true" cache-expand="particle-system-forceOvertimeModule"></ui-section>
|
||||
<ui-section empty="true" key="sizeOvertimeModule"
|
||||
cache-expand="particle-system-sizeOvertimeModule">
|
||||
<ui-prop slot="header" no-label class="header" type="dump" key="sizeOvertimeModule.value.enable"
|
||||
labelflag="sizeOvertimeModule" empty="true">
|
||||
@@ -120,7 +120,7 @@ exports.template = /* html*/`
|
||||
<ui-prop type="dump" key="sizeOvertimeModule.value.y"></ui-prop>
|
||||
<ui-prop type="dump" key="sizeOvertimeModule.value.z"></ui-prop>
|
||||
</ui-section>
|
||||
<ui-section empty="true" class="config" key="rotationOvertimeModule"
|
||||
<ui-section empty="true" key="rotationOvertimeModule"
|
||||
cache-expand="particle-system-rotationOvertimeModule">
|
||||
<ui-prop slot="header" no-label class="header" type="dump" key="rotationOvertimeModule.value.enable"
|
||||
labelflag="rotationOvertimeModule" empty="true">
|
||||
@@ -132,11 +132,11 @@ exports.template = /* html*/`
|
||||
<ui-prop type="dump" key="rotationOvertimeModule.value.y"></ui-prop>
|
||||
<ui-prop type="dump" key="rotationOvertimeModule.value.z"></ui-prop>
|
||||
</ui-section>
|
||||
<ui-section class="config" key="colorOverLifetimeModule" autoflag="true"
|
||||
<ui-section key="colorOverLifetimeModule" autoflag="true"
|
||||
cache-expand="particle-system-colorOverLifetimeModule"></ui-section>
|
||||
<ui-section class="config" key="textureAnimationModule" autoflag="true"
|
||||
<ui-section key="textureAnimationModule" autoflag="true"
|
||||
cache-expand="particle-system-textureAnimationModule"></ui-section>
|
||||
<ui-section type="dump" showflag="!renderer.value.useGPU" key="limitVelocityOvertimeModule" class="config"
|
||||
<ui-section type="dump" showflag="!renderer.value.useGPU" key="limitVelocityOvertimeModule"
|
||||
cache-expand="particle-system-limitVelocityOvertimeModule">
|
||||
<ui-prop slot="header" no-label class="header" type="dump" key="limitVelocityOvertimeModule.value.enable"
|
||||
labelflag="limitVelocityOvertimeModule" empty="true">
|
||||
@@ -151,7 +151,7 @@ exports.template = /* html*/`
|
||||
<ui-prop type="dump" key="limitVelocityOvertimeModule.value.limitY"></ui-prop>
|
||||
<ui-prop type="dump" key="limitVelocityOvertimeModule.value.limitZ"></ui-prop>
|
||||
</ui-section>
|
||||
<ui-section empty="true" class="config" showflag="!renderer.value.useGPU" key="trailModule"
|
||||
<ui-section empty="true" showflag="!renderer.value.useGPU" key="trailModule"
|
||||
cache-expand="particle-system-trailModule">
|
||||
<ui-prop slot="header" no-label class="header" type="dump" key="trailModule.value.enable" labelflag="trailModule"
|
||||
empty="true">
|
||||
@@ -169,7 +169,7 @@ exports.template = /* html*/`
|
||||
<ui-prop type="dump" key="trailModule.value.colorOverTrail"></ui-prop>
|
||||
<ui-prop type="dump" key="trailModule.value.colorOvertime"></ui-prop>
|
||||
</ui-section>
|
||||
<ui-prop type="dump" key="renderer" ui-section-config></ui-prop>
|
||||
<ui-prop type="dump" key="renderer"></ui-prop>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ module.paths.push(join(Editor.App.path, 'node_modules'));
|
||||
const Vue = require('vue/dist/vue.min.js');
|
||||
const propUtils = require('../utils/prop');
|
||||
|
||||
const cssMediaWidth = 340;
|
||||
|
||||
exports.template = `
|
||||
<style>
|
||||
.widget-component {
|
||||
@@ -119,7 +121,7 @@ exports.template = `
|
||||
left: 25%;
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
z-index: 10;
|
||||
z-index: 2;
|
||||
background-color: var(--color-normal-fill);
|
||||
border: 1px solid var(--color-normal-fill-important);
|
||||
border-radius: 2px;
|
||||
@@ -1186,18 +1188,13 @@ const computed = {
|
||||
},
|
||||
};
|
||||
exports.ready = function() {
|
||||
let requestAnimationFrameId = null;
|
||||
this.resizeObserver = new window.ResizeObserver(() => {
|
||||
if (requestAnimationFrameId !== null) { return; }
|
||||
requestAnimationFrameId = window.requestAnimationFrame(() => {
|
||||
const rect = this.$this.getBoundingClientRect();
|
||||
if (rect.width > 340) {
|
||||
this.layout = 'horizontal';
|
||||
} else {
|
||||
this.layout = 'vertical';
|
||||
}
|
||||
requestAnimationFrameId = null;
|
||||
});
|
||||
const rect = this.$this.getBoundingClientRect();
|
||||
if (rect.width > cssMediaWidth) {
|
||||
this.layout = 'horizontal';
|
||||
} else {
|
||||
this.layout = 'vertical';
|
||||
}
|
||||
});
|
||||
|
||||
this.resizeObserver.observe(this.$this);
|
||||
@@ -1214,7 +1211,7 @@ exports.update = function(dump) {
|
||||
this.dimensionHorizontal = this.getDimensionHorizontal();
|
||||
this.dimensionVertical = this.getDimensionVertical();
|
||||
const rect = this.$this.getBoundingClientRect();
|
||||
if (rect.width > 300) {
|
||||
if (rect.width > cssMediaWidth) {
|
||||
this.layout = 'horizontal';
|
||||
} else {
|
||||
this.layout = 'vertical';
|
||||
|
||||
Reference in New Issue
Block a user