public void CopyValuesFrom(PsyiaSettings copyTarget) { System = new PsyiasSystemSettings(copyTarget.System); Visual = new PsyiaVisualSettings(copyTarget.Visual); Physics = new PsyiaPhysicsSettings(copyTarget.Physics); Audio = new PsyiaAudioSettings(copyTarget.Audio); Controller = new PsyiaControllerSettings(copyTarget.Controller); ForceLeft = new PsyiaForceSettings(copyTarget.ForceLeft); ForceRight = new PsyiaForceSettings(copyTarget.ForceRight); EmitterLeft = new PsyiaEmitterSettings(copyTarget.EmitterLeft); EmitterRight = new PsyiaEmitterSettings(copyTarget.EmitterRight); }
public PsyiaForceSettings(PsyiaForceSettings copyTarget) { ForceShape = copyTarget.ForceShape; ForceAttenuation = copyTarget.ForceAttenuation; ForceStrength = copyTarget.ForceStrength; ForceStrengthVis = copyTarget.ForceStrengthVis; AttenuationDistance = copyTarget.AttenuationDistance; AttenuationDistanceVis = copyTarget.AttenuationDistanceVis; SofteningFactor = copyTarget.SofteningFactor; SofteningFactorVis = copyTarget.SofteningFactorVis; Wavelength = copyTarget.Wavelength; WavelengthVis = copyTarget.WavelengthVis; }
public void CopyValuesFrom(string jsonString) { var jsonObject = (JSONObject)JSONNode.Parse(jsonString); System = new PsyiasSystemSettings { MaxParticleCount = jsonObject["System"]["MaxParticleCount"].AsInt, Antialiasing = (PsyiasSystemSettings.AntialiasingLevel)jsonObject["System"]["Antialiasing"].AsInt, Bloom = jsonObject["System"]["Bloom"].AsBool }; Visual = new PsyiaVisualSettings { ParticleForm = (PsyiaVisualSettings.Form)jsonObject["Visual"]["ParticleForm"].AsInt, ParticleColor = (PsyiaVisualSettings.Color)jsonObject["Visual"]["ParticleColor"].AsInt, ParticleColorAmount = jsonObject["Visual"]["ParticleColorAmount"].AsFloat, ParticleColorAmountVis = (SliderAudioHook.AudioDataSource)jsonObject["Visual"]["ParticleColorAmount"].AsInt, ParticleSize = jsonObject["Visual"]["ParticleSize"].AsFloat, ParticleSizeVis = (SliderAudioHook.AudioDataSource)jsonObject["Visual"]["ParticleSize"].AsInt, LineLength = jsonObject["Visual"]["LineLength"].AsFloat, LineLengthVis = (SliderAudioHook.AudioDataSource)jsonObject["Visual"]["LineLength"].AsInt, ParticleShape = (PsyiaVisualSettings.Shape)jsonObject["Visual"]["ParticleShape"].AsInt }; Physics = new PsyiaPhysicsSettings { ParticleMass = jsonObject["Physics"]["ParticleMass"].AsFloat, ParticleMassVis = (SliderAudioHook.AudioDataSource)jsonObject["Physics"]["ParticleMass"].AsInt, ParticleDamping = jsonObject["Physics"]["ParticleDamping"].AsFloat, ParticleDampingVis = (SliderAudioHook.AudioDataSource)jsonObject["Physics"]["ParticleDamping"].AsInt, TimeSpeed = jsonObject["Physics"]["TimeSpeed"].AsFloat, TimeSpeedVis = (SliderAudioHook.AudioDataSource)jsonObject["Physics"]["TimeSpeed"].AsInt, FloorCollision = jsonObject["Physics"]["FloorCollision"].AsBool }; Audio = new PsyiaAudioSettings { VisualsAudioreactivity = jsonObject["Audio"]["VisualsAudioreactivity"].AsFloat, PhysicsAudioreactivity = jsonObject["Audio"]["PhysicsAudioreactivity"].AsFloat, Volume = jsonObject["Audio"]["Volume"].AsFloat, Loop = jsonObject["Audio"]["Loop"].AsBool, SlowWithTime = jsonObject["Audio"]["SlowWithTime"].AsBool }; Controller = new PsyiaControllerSettings { ControllerSymmetry = (PsyiaControllerSettings.Symmetry)jsonObject["Controller"]["ControllerSymmetry"].AsInt, ControllerModels = jsonObject["Controller"]["ControllerModels"].AsBool, ControllerDistance = jsonObject["Controller"]["ControllerDistance"].AsFloat, ControllerDistanceVis = (SliderAudioHook.AudioDataSource)jsonObject["Controller"]["ControllerDistance"].AsInt, ControllerHaptics = jsonObject["Controller"]["ControllerHaptics"].AsBool }; ForceLeft = new PsyiaForceSettings { ForceShape = (PsyiaForceSettings.Shape)jsonObject["ForceLeft"]["ForceShape"].AsInt, ForceAttenuation = (PsyiaForceSettings.Attenuation)jsonObject["ForceLeft"]["ForceAttenuation"].AsInt, ForceStrength = jsonObject["ForceLeft"]["ForceStrength"].AsFloat, ForceStrengthVis = (SliderAudioHook.AudioDataSource)jsonObject["ForceLeft"]["ForceStrength"].AsInt, AttenuationDistance = jsonObject["ForceLeft"]["AttenuationDistance"].AsFloat, AttenuationDistanceVis = (SliderAudioHook.AudioDataSource)jsonObject["ForceLeft"]["AttenuationDistance"].AsInt, SofteningFactor = jsonObject["ForceLeft"]["SofteningFactor"].AsFloat, SofteningFactorVis = (SliderAudioHook.AudioDataSource)jsonObject["ForceLeft"]["SofteningFactor"].AsInt, Wavelength = jsonObject["ForceLeft"]["Wavelength"].AsFloat, WavelengthVis = (SliderAudioHook.AudioDataSource)jsonObject["ForceLeft"]["Wavelength"].AsInt }; ForceRight = new PsyiaForceSettings { ForceShape = (PsyiaForceSettings.Shape)jsonObject["ForceRight"]["ForceShape"].AsInt, ForceAttenuation = (PsyiaForceSettings.Attenuation)jsonObject["ForceRight"]["ForceAttenuation"].AsInt, ForceStrength = jsonObject["ForceRight"]["ForceStrength"].AsFloat, ForceStrengthVis = (SliderAudioHook.AudioDataSource)jsonObject["ForceRight"]["ForceStrength"].AsInt, AttenuationDistance = jsonObject["ForceRight"]["AttenuationDistance"].AsFloat, AttenuationDistanceVis = (SliderAudioHook.AudioDataSource)jsonObject["ForceRight"]["AttenuationDistance"].AsInt, SofteningFactor = jsonObject["ForceRight"]["SofteningFactor"].AsFloat, SofteningFactorVis = (SliderAudioHook.AudioDataSource)jsonObject["ForceRight"]["SofteningFactor"].AsInt, Wavelength = jsonObject["ForceRight"]["Wavelength"].AsFloat, WavelengthVis = (SliderAudioHook.AudioDataSource)jsonObject["ForceRight"]["Wavelength"].AsInt }; EmitterLeft = new PsyiaEmitterSettings { EmitterCount = jsonObject["EmitterLeft"]["EmitterCount"].AsInt, EmitterRadius = jsonObject["EmitterLeft"]["EmitterRadius"].AsFloat, EmitterRadiusVis = (SliderAudioHook.AudioDataSource)jsonObject["EmitterLeft"]["EmitterRadius"].AsInt, EmitterVelocity = jsonObject["EmitterLeft"]["EmitterVelocity"].AsFloat, EmitterVelocityVis = (SliderAudioHook.AudioDataSource)jsonObject["EmitterLeft"]["EmitterVelocity"].AsInt, VelocitySpread = jsonObject["EmitterLeft"]["VelocitySpread"].AsFloat, VelocitySpreadVis = (SliderAudioHook.AudioDataSource)jsonObject["EmitterLeft"]["VelocitySpread"].AsInt, InheritVelocity = jsonObject["EmitterLeft"]["InheritVelocity"].AsFloat, InheritVelocityVis = (SliderAudioHook.AudioDataSource)jsonObject["EmitterLeft"]["InheritVelocity"].AsInt }; EmitterRight = new PsyiaEmitterSettings { EmitterCount = jsonObject["EmitterRight"]["EmitterCount"].AsInt, EmitterRadius = jsonObject["EmitterRight"]["EmitterRadius"].AsFloat, EmitterRadiusVis = (SliderAudioHook.AudioDataSource)jsonObject["EmitterRight"]["EmitterRadius"].AsInt, EmitterVelocity = jsonObject["EmitterRight"]["EmitterVelocity"].AsFloat, EmitterVelocityVis = (SliderAudioHook.AudioDataSource)jsonObject["EmitterRight"]["EmitterVelocity"].AsInt, VelocitySpread = jsonObject["EmitterRight"]["VelocitySpread"].AsFloat, VelocitySpreadVis = (SliderAudioHook.AudioDataSource)jsonObject["EmitterRight"]["VelocitySpread"].AsInt, InheritVelocity = jsonObject["EmitterRight"]["InheritVelocity"].AsFloat, InheritVelocityVis = (SliderAudioHook.AudioDataSource)jsonObject["EmitterRight"]["InheritVelocity"].AsInt }; }