Particle texture loading
This commit is contained in:
parent
edb438bef0
commit
808c28e6ba
@ -1102,6 +1102,24 @@ Object.assign(Clipbench, {
|
||||
}
|
||||
})
|
||||
|
||||
if (isApp) {
|
||||
Wintersky.fetchTexture = function(config) {
|
||||
console.log(`trying to fetch texture with ${config.file_path} and ${config.particle_texture_path}`)
|
||||
if (config.file_path && config.particle_texture_path) {
|
||||
|
||||
let path_arr = config.file_path.split(PathModule.sep);
|
||||
let particle_index = path_arr.indexOf('particles')
|
||||
path_arr.splice(particle_index)
|
||||
let filePath = PathModule.join(path_arr.join(PathModule.sep), config.particle_texture_path.replace(/\.png$/, '')+'.png')
|
||||
|
||||
if (fs.existsSync(filePath)) {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const Animator = {
|
||||
possible_channels: {rotation: true, position: true, scale: true, sound: true, particle: true, timeline: true},
|
||||
open: false,
|
||||
|
@ -588,7 +588,7 @@ const Timeline = {
|
||||
} else {
|
||||
Timeline.particle_emitters[path] = [];
|
||||
}
|
||||
let emitter = new Wintersky.Emitter(json_content);
|
||||
let emitter = new Wintersky.Emitter(json_content, {path});
|
||||
emitter.loop_mode = 'once';
|
||||
Timeline.particle_emitters[path].push(emitter);
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user