private static Example.SkillParticleEmitter ExportParticleEmitter(SkillParticleEmitterItem emitter, List <Example.SkillParticleEmitter> emitters) { Example.SkillParticleEmitter particleEmitter = new Example.SkillParticleEmitter(); List <Example.SkillParticle> skillParticles = new List <Example.SkillParticle>(); var particles = emitter.GetComponentsInChildren <SkillParticleActionItem>(); foreach (var particle in particles) { ExportSkillParticle(particle, skillParticles); } if (emitter is AutoSkillParticleEmitterItem) { AutoSkillParticleEmitterItem autoEmitter = (AutoSkillParticleEmitterItem)emitter; particleEmitter.emitterType = autoEmitter.emitterType; particleEmitter.StartTime = Mathf.FloorToInt(autoEmitter.Firetime * 1000); particleEmitter.Duration = Mathf.FloorToInt(autoEmitter.Duration * 1000); particleEmitter.EmitterShape = ExportSkillShape(autoEmitter.emitterShape); particleEmitter.EmitterPosition = MathUtil.ToVector3f(autoEmitter.emitterOffset); particleEmitter.ParticleTemplate = skillParticles.Count > 0 ? skillParticles[0] : null; particleEmitter.Particles = skillParticles; } else if (emitter is ManualSkillParticleEmitterItem) { ManualSkillParticleEmitterItem autoEmitter = (ManualSkillParticleEmitterItem)emitter; particleEmitter.emitterType = autoEmitter.emitterType; particleEmitter.StartTime = Mathf.FloorToInt(autoEmitter.Firetime * 1000); particleEmitter.Duration = Mathf.FloorToInt(autoEmitter.Duration * 1000); particleEmitter.Particles = skillParticles; } emitters.Add(particleEmitter); return(particleEmitter); }
private static Example.SkillParticleEmitter ExportParticleEmitter(SkillParticleEmitter emitter, List <Example.SkillParticleEmitter> emitters) { Example.SkillParticleEmitter particleEmitter = new Example.SkillParticleEmitter(); List <Example.SkillParticle> skillParticles = new List <Example.SkillParticle> (); var particles = emitter.GetComponentsInChildren <SkillParticle> (); foreach (var particle in particles) { ExportSkillParticle(particle, skillParticles); } particleEmitter.emitterType = emitter.emitterType; particleEmitter.StartTime = emitter.startFrame; particleEmitter.Duration = emitter.duration; particleEmitter.EmitterShape = ExportSkillShape(emitter.EmitterShape); particleEmitter.EmitterPosition = MathUtil.ToVector3f(emitter.EmitterPosition); particleEmitter.ParticleTemplate = skillParticles.Count > 0?skillParticles [0]:null; particleEmitter.Particles = skillParticles; emitters.Add(particleEmitter); return(particleEmitter); }