未验证 提交 68a2e812 编写于 作者: E etr2460 提交者: GitHub

Parse AnimationClip with UUID from json blob

If the JSON blob contains a UUID then use it. Otherwise, generate a new UUID
上级 4da3cc11
......@@ -13,13 +13,13 @@ import { _Math } from '../math/Math.js';
* @author David Sarno / http://lighthaus.us/
*/
function AnimationClip( name, duration, tracks ) {
function AnimationClip( name, duration, tracks, uuid = _Math.generateUUID() ) {
this.name = name;
this.tracks = tracks;
this.duration = ( duration !== undefined ) ? duration : - 1;
this.uuid = _Math.generateUUID();
this.uuid = uuid;
// this means it should figure out its duration by scanning the tracks
if ( this.duration < 0 ) {
......@@ -46,7 +46,7 @@ Object.assign( AnimationClip, {
}
return new AnimationClip( json.name, json.duration, tracks );
return new AnimationClip( json.name, json.duration, tracks, json.uuid );
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册