Skip to content

Commit

Permalink
Unify animation event interfaces (cocos#9101)
Browse files Browse the repository at this point in the history
* Unify animation event interfaces

* update event edit (#27)

# Conflicts:
#	editor/inspector/assets/fbx/event-editor/editor.js

Co-authored-by: 媛媛 <yuanyuan1497@foxmail.com>
  • Loading branch information
shrinktofit and yanOO1497 authored Aug 5, 2021
1 parent 2f8c25c commit a40115e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
19 changes: 2 additions & 17 deletions editor/inspector/assets/fbx/event-editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,7 @@ exports.methods = {

async saveData() {
const that = this;
const result = that.value.map((item) => {
// TODO Animation events recorded in meta need to be unified https://github.com/cocos-creator/3d-tasks/issues/7416
return {
functionName: item.func,
parameters: item.params,
frame: that.frame,
};
});
that.$emit('update', that.frame, result);
that.$emit('update', that.frame, that.value);
that.dirty = false;
},

Expand All @@ -135,14 +127,7 @@ exports.methods = {
that.value = [];
return;
}
that.value = data.map((item) => {
// TODO Animation events recorded in meta need to be unified
return {
frame: that.frame,
func: item.functionName,
params: item.parameters,
};
});
that.value = JSON.parse(JSON.stringify(data));
that.newFuncName = '';
},
};
Expand Down
4 changes: 2 additions & 2 deletions editor/inspector/assets/fbx/events/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ exports.data = {
eventEditorInfo: {
frame: 0,
events: [{
functionName: '',
parameters: [],
func: '',
params: [],
frame: 0,
}],
},
Expand Down
4 changes: 2 additions & 2 deletions editor/inspector/assets/fbx/events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ exports.apply = async function() {
exports.addNewEvent = function(time) {
const newInfo = {
frame: time,
functionName: '',
parameters: [],
func: '',
params: [],
};
const userData = this.curEditClipInfo.userData;
if (!userData.events) {
Expand Down

0 comments on commit a40115e

Please sign in to comment.