public void addObject(SmokeData data) { smokeObjectsData.Add(data.index, data); switch (data.geometryData.geometryType) { case GeometryData.GeometryType.CUBE: break; case GeometryData.GeometryType.SPHERE: break; case GeometryData.GeometryType.CYLINDER: break; default: break; } }
public void load(string path) { //删除现有的object List <int> deleteIndex = new List <int>(); foreach (var item in data) { if (item.Key > 2) { deleteIndex.Add(item.Key); } } foreach (var item in deleteIndex) { destroyObject(item); } StreamReader sr = new StreamReader(path, Encoding.Default); string line; string[] lineParts; //configuration line = sr.ReadLine(); lineParts = line.Split('-'); number = int.Parse(lineParts[1].Substring(lineParts[1].IndexOf('=') + 1)); //ground line = sr.ReadLine(); lineParts = line.Split('-'); ((GroundData)data[0]).size = float.Parse(lineParts[5].Substring(lineParts[5].IndexOf('=') + 1)); setData(data[0]); //light line = sr.ReadLine(); lineParts = line.Split('-'); ((LightData)data[1]).intensity = float.Parse(lineParts[5].Substring(lineParts[5].IndexOf('=') + 1)); string[] RGB = lineParts[6].Split(':'); int r = int.Parse(RGB[1].Substring(RGB[1].IndexOf('=') + 1)); int g = int.Parse(RGB[2].Substring(RGB[2].IndexOf('=') + 1)); int b = int.Parse(RGB[3].Substring(RGB[3].IndexOf('=') + 1)); ((LightData)data[1]).color = new Color(r, g, b); setData(data[1]); //logDensity line = sr.ReadLine(); lineParts = line.Split('-'); ((LogSmokeDensityData)data[2]).logFlag = bool.Parse(lineParts[5].Substring(lineParts[5].IndexOf('=') + 1)); ((LogSmokeDensityData)data[2]).interval = float.Parse(lineParts[6].Substring(lineParts[6].IndexOf('=') + 1)); setData(data[2]); //data while ((line = sr.ReadLine()) != null) { lineParts = line.Split('-'); Data newData = new Data(0, "", 0, false); newData.index = int.Parse(lineParts[1].Substring(lineParts[1].IndexOf('=') + 1)); newData.name = lineParts[2].Substring(lineParts[2].IndexOf('=') + 1); newData.deletable = bool.Parse(lineParts[4].Substring(lineParts[4].IndexOf('=') + 1)); switch (lineParts[3].Substring(lineParts[3].IndexOf('=') + 1)) { case "BARRIER": { newData.dataType = Data.type.BARRIER; BarrierData barrierData = null; Vector3 position = vector3Parse(lineParts[6].Substring(lineParts[6].IndexOf('=') + 1)); string typeString = lineParts[5].Substring(lineParts[5].IndexOf('=') + 1); switch (typeString) { case "cube": { Vector3 size = vector3Parse(lineParts[7].Substring(lineParts[7].IndexOf('=') + 1)); Vector3 direction = vector3Parse(lineParts[8].Substring(lineParts[8].IndexOf('=') + 1)); CubeGeometryData cubeGeometryData = new CubeGeometryData(position, size, direction); barrierData = new BarrierData(newData.index, newData.name, newData.dataType, newData.deletable, cubeGeometryData); addObject(barrierData); break; } case "sphere": { float radius = float.Parse((lineParts[7].Substring(lineParts[7].IndexOf('=') + 1))); SphereGeometryData sphereGeometryData = new SphereGeometryData(position, radius); barrierData = new BarrierData(newData.index, newData.name, newData.dataType, newData.deletable, sphereGeometryData); addObject(barrierData); break; } case "cylinder": { float radius = float.Parse((lineParts[7].Substring(lineParts[7].IndexOf('=') + 1))); float height = float.Parse((lineParts[8].Substring(lineParts[8].IndexOf('=') + 1))); Vector3 direction = vector3Parse(lineParts[9].Substring(lineParts[9].IndexOf('=') + 1)); CylinderGeometryData cylinderGeometryData = new CylinderGeometryData(position, radius, height, direction); barrierData = new BarrierData(newData.index, newData.name, newData.dataType, newData.deletable, cylinderGeometryData); addObject(barrierData); break; } } break; } case "WIND": { newData.dataType = Data.type.WIND; WindData windData = null; float intensity = float.Parse(lineParts[5].Substring(lineParts[5].IndexOf('=') + 1)); float interfence = float.Parse(lineParts[6].Substring(lineParts[6].IndexOf('=') + 1)); Vector3 position = vector3Parse(lineParts[8].Substring(lineParts[8].IndexOf('=') + 1)); string typeString = lineParts[7].Substring(lineParts[7].IndexOf('=') + 1); switch (typeString) { case "cube": { Vector3 size = vector3Parse(lineParts[9].Substring(lineParts[9].IndexOf('=') + 1)); Vector3 direction = vector3Parse(lineParts[10].Substring(lineParts[10].IndexOf('=') + 1)); CubeGeometryData cubeGeometryData = new CubeGeometryData(position, size, direction); windData = new WindData(newData.index, newData.name, newData.dataType, newData.deletable, cubeGeometryData, intensity, interfence); addObject(windData); break; } case "sphere": { float radius = float.Parse((lineParts[9].Substring(lineParts[9].IndexOf('=') + 1))); SphereGeometryData sphereGeometryData = new SphereGeometryData(position, radius); windData = new WindData(newData.index, newData.name, newData.dataType, newData.deletable, sphereGeometryData, intensity, interfence); addObject(windData); break; } case "cylinder": { float radius = float.Parse((lineParts[9].Substring(lineParts[9].IndexOf('=') + 1))); float height = float.Parse((lineParts[10].Substring(lineParts[10].IndexOf('=') + 1))); Vector3 direction = Vector3.zero; CylinderGeometryData cylinderGeometryData = new CylinderGeometryData(position, radius, height, direction); windData = new WindData(newData.index, newData.name, newData.dataType, newData.deletable, cylinderGeometryData, intensity, interfence); addObject(windData); break; } } break; } case "SMOKE": { newData.dataType = Data.type.SMOKE; SmokeData smokeData = null; string smokeTypeString = lineParts[5].Substring(lineParts[5].IndexOf('=') + 1); switch (smokeTypeString) { case "smoke": { float duration = float.Parse(lineParts[6].Substring(lineParts[6].IndexOf('=') + 1)); int maxNumber = int.Parse(lineParts[7].Substring(lineParts[7].IndexOf('=') + 1)); float particleSize = float.Parse(lineParts[8].Substring(lineParts[8].IndexOf('=') + 1)); float speed = float.Parse(lineParts[9].Substring(lineParts[9].IndexOf('=') + 1)); RGB = lineParts[10].Split(':'); int r_value = int.Parse(RGB[1].Substring(RGB[1].IndexOf('=') + 1)); int g_value = int.Parse(RGB[2].Substring(RGB[2].IndexOf('=') + 1)); int b_value = int.Parse(RGB[3].Substring(RGB[3].IndexOf('=') + 1)); Color color = new Color(r_value, g_value, b_value); Vector3 position = vector3Parse(lineParts[12].Substring(lineParts[12].IndexOf('=') + 1)); string typeString = lineParts[11].Substring(lineParts[11].IndexOf('=') + 1); switch (typeString) { case "cycle": { float radius = float.Parse((lineParts[13].Substring(lineParts[13].IndexOf('=') + 1))); Vector3 direction = vector3Parse(lineParts[14].Substring(lineParts[14].IndexOf('=') + 1)); CycleGeometryData cycleGeometryData = new CycleGeometryData(position, radius, direction); smokeData = new SmokeData(newData.index, newData.name, newData.dataType, newData.deletable, cycleGeometryData, new PhysicalData(particleSize, duration, maxNumber, speed), SmokeData.SmokeType.SMOKE, color); addObject(smokeData); break; } case "cylinder": { float radius = float.Parse((lineParts[13].Substring(lineParts[13].IndexOf('=') + 1))); float height = float.Parse((lineParts[14].Substring(lineParts[14].IndexOf('=') + 1))); Vector3 direction = vector3Parse((lineParts[15].Substring(lineParts[15].IndexOf('=') + 1))); CylinderGeometryData cylinderGeometryData = new CylinderGeometryData(position, radius, height, direction); smokeData = new SmokeData(newData.index, newData.name, newData.dataType, newData.deletable, cylinderGeometryData, new PhysicalData(particleSize, duration, maxNumber, speed), SmokeData.SmokeType.SMOKE, color); addObject(smokeData); break; } } break; } case "fire": { CycleGeometryData cycleGeometryData = new CycleGeometryData( new Vector3(0f, 0.5f, 0f), 0.1f, new Vector3(0f, 0f, 0f) ); PhysicalData physicalData = new PhysicalData( 0.01f, 10.0f, 1000, 3f ); smokeData = new SmokeData(smokeData.index, smokeData.name, Data.type.BARRIER, true, cycleGeometryData, physicalData, SmokeData.SmokeType.FIRE, new Color(0, 0, 0)); addObject(smokeData); break; } case "explosion": { CycleGeometryData cycleGeometryData = new CycleGeometryData( new Vector3(0f, 0.5f, 0f), 0.1f, new Vector3(0f, 0f, 0f) ); PhysicalData physicalData = new PhysicalData( 0.01f, 10.0f, 1000, 3f ); smokeData = new SmokeData(smokeData.index, smokeData.name, Data.type.BARRIER, true, cycleGeometryData, physicalData, SmokeData.SmokeType.FIRE, new Color(0, 0, 0)); addObject(smokeData); break; } } break; } } } }
//file public void save(string path) { FileStream fs = new FileStream(path, FileMode.Create); StreamWriter sw = new StreamWriter(fs); string line = ""; //write configuration line = "configuration" + "-" + "number=" + number.ToString(); sw.Write(line); sw.Write("\n"); //write data foreach (var item in data) { line = "data" + "-"; line = line + "index=" + item.Key + "-"; line = line + "name=" + item.Value.name + "-"; line = line + "type=" + item.Value.dataTypeToString(item.Value.dataType) + "-"; line = line + "deletable=" + item.Value.deletable.ToString() + "-"; switch (item.Value.dataType) { case Data.type.GROUND: { GroundData groundData = ((GroundData)item.Value); line = line + "size=" + groundData.size; break; } case Data.type.LIGHT: { LightData lightData = ((LightData)item.Value); line = line + "intensity=" + lightData.intensity.ToString() + "-"; line = line + "color:R=" + lightData.color.r.ToString() + ":G=" + lightData.color.g.ToString() + ":B=" + lightData.color.b.ToString(); break; } case Data.type.LOGDENSITY: { LogSmokeDensityData logSmokeDensityData = ((LogSmokeDensityData)item.Value); line = line + "logFlag=" + logSmokeDensityData.logFlag.ToString() + "-"; line = line + "interval=" + logSmokeDensityData.interval.ToString(); break; } case Data.type.BARRIER: { BarrierData barrierData = ((BarrierData)item.Value); line = line + "geometryType=" + barrierData.geometryData.getGeometryTypeStringArray()[(int)barrierData.geometryData.geometryType] + "-"; line = line + "position=" + barrierData.geometryData.position.ToString() + "-"; switch (barrierData.geometryData.geometryType) { case GeometryData.GeometryType.CUBE: { line = line + "size=" + ((CubeGeometryData)barrierData.geometryData).size.ToString() + "-"; line = line + "direction=" + ((CubeGeometryData)barrierData.geometryData).direction.ToString(); break; } case GeometryData.GeometryType.SPHERE: { line = line + "r=" + ((SphereGeometryData)barrierData.geometryData).r.ToString(); break; } case GeometryData.GeometryType.CYLINDER: { line = line + "r=" + ((CylinderGeometryData)barrierData.geometryData).r.ToString() + "-"; line = line + "height=" + ((CylinderGeometryData)barrierData.geometryData).height.ToString() + "-"; line = line + "direction=" + ((CylinderGeometryData)barrierData.geometryData).direction.ToString(); break; } } break; } case Data.type.WIND: { WindData windData = ((WindData)item.Value); line = line + "intensity=" + windData.intensity.ToString() + "-"; line = line + "interference=" + windData.interference.ToString() + "-"; line = line + "geometryType=" + windData.geometryData.getGeometryTypeStringArray()[(int)windData.geometryData.geometryType] + "-"; line = line + "position=" + windData.geometryData.position.ToString() + "-"; switch (windData.geometryData.geometryType) { case GeometryData.GeometryType.CUBE: { line = line + "size=" + ((CubeGeometryData)windData.geometryData).size.ToString() + "-"; line = line + "direction=" + ((CubeGeometryData)windData.geometryData).direction.ToString(); break; } case GeometryData.GeometryType.SPHERE: { line = line + "r=" + ((SphereGeometryData)windData.geometryData).r.ToString(); break; } case GeometryData.GeometryType.CYLINDER: { line = line + "r=" + ((CylinderGeometryData)windData.geometryData).r.ToString() + "-"; line = line + "height=" + ((CylinderGeometryData)windData.geometryData).height.ToString(); break; } } break; } case Data.type.SMOKE: { SmokeData smokeData = ((SmokeData)item.Value); switch (smokeData.smokeType) { case SmokeData.SmokeType.SMOKE: { line = line + "smokeType=smoke-"; line = line + "duration=" + smokeData.physicalData.duration.ToString() + "-"; line = line + "maxNumber=" + smokeData.physicalData.maxNumber.ToString() + "-"; line = line + "particleSize=" + smokeData.physicalData.particleSize.ToString() + "-"; line = line + "speed=" + smokeData.physicalData.speed.ToString() + "-"; line = line + "color:R=" + smokeData.color.r.ToString() + ":G=" + smokeData.color.g.ToString() + ":B=" + smokeData.color.b.ToString() + "-"; line = line + "geometryType=" + smokeData.geometryData.getGeometryTypeStringArray()[(int)smokeData.geometryData.geometryType] + "-"; line = line + "position=" + smokeData.geometryData.position.ToString() + "-"; switch (smokeData.geometryData.geometryType) { case GeometryData.GeometryType.CYCLE: { line = line + "r=" + ((CycleGeometryData)smokeData.geometryData).r.ToString() + "-"; line = line + "direction=" + ((CycleGeometryData)smokeData.geometryData).direction.ToString(); break; } case GeometryData.GeometryType.CONE: { line = line + "r=" + ((ConeGeometryData)smokeData.geometryData).r.ToString() + "-"; line = line + "height=" + ((ConeGeometryData)smokeData.geometryData).height.ToString() + "-"; line = line + "direction=" + ((ConeGeometryData)smokeData.geometryData).direction.ToString(); break; } } break; } case SmokeData.SmokeType.FIRE: { line = line + "smokeType=fire-"; break; } case SmokeData.SmokeType.EXPLOSION: { line = line + "smokeType=explosion-"; break; } } break; } default: { break; } } sw.Write(line); sw.Write("\n"); } sw.Flush(); sw.Close(); fs.Close(); }
public void toAddConfiguration(Data.type type) { // Debug.Log(type); Data objectData = null; switch (type) { case Data.type.BARRIER: { number = number + 1; CubeGeometryData cubeGeometryData = new CubeGeometryData( new Vector3(0f, 0.5f, 0f), new Vector3(0.2f, 0.2f, 0.2f), new Vector3(0f, 0f, 0f) ); // Debug.Log(number); objectData = new BarrierData(number, "Barrier" + number.ToString(), Data.type.BARRIER, true, cubeGeometryData); break; } case Data.type.WIND: { number = number + 1; CubeGeometryData cubeGeometryData = new CubeGeometryData( new Vector3(0f, 0.5f, 0f), new Vector3(0.2f, 0.2f, 0.2f), new Vector3(0f, 0f, 0f) ); // Debug.Log(number); objectData = new WindData(number, "Wind" + number.ToString(), Data.type.WIND, true, cubeGeometryData, 1f, 0f); break; } case Data.type.SMOKE: { number = number + 1; CycleGeometryData cycleGeometryData = new CycleGeometryData( new Vector3(0f, 0.5f, 0f), 0.1f, new Vector3(0f, 0f, 0f) ); PhysicalData physicalData = new PhysicalData( 0.01f, 10.0f, 1000, 3f ); objectData = new SmokeData(number, "Smoke" + number.ToString(), Data.type.SMOKE, true, cycleGeometryData, physicalData, SmokeData.SmokeType.SMOKE, new Color(0, 0, 0)); break; } default: { string logString = "[Error] the " + new Data().dataTypeToString(type) + " object can't be added"; addLog(logString); break; } } if (objectData != null) { // Debug.Log(objectData.dataType); ObjectConfigurationPanel.GetComponent <ObjectConfigurationPanelController>().showConfigurePanel(objectData, ObjectConfigurationPanelController.ConfigurationMode.ADD); } }
public void deleteObject(SmokeData data) { smokeObjectsData.Remove(data.index); }
public void setObject(SmokeData data) { smokeObjectsData.Remove(data.index); addObject(data); }
public void init(SmokeData _smokeData) { smokeData = _smokeData; smokeTypeSetLine = transform.GetChild(0).gameObject; bool[] value0 = { false, false, false }; value0[(int)_smokeData.smokeType] = true; smokeTypeSetLine.GetComponent <ThreeTypeChooseLineController>().init("smoke type", _smokeData.getSmokeTypeStringArray(), value0); if (_smokeData.smokeType != SmokeData.SmokeType.SMOKE) { geometrySetLine.SetActive(false); positionSetLine.SetActive(false); cycleSetLine.SetActive(false); coneSetLine.SetActive(false); directionSetLine.SetActive(false); physicalSetLine0.SetActive(false); physicalSetLine1.SetActive(false); colorSetLine.SetActive(false); return; } geometrySetLine = transform.GetChild(1).gameObject; geometrySetLine.SetActive(true); string[] key1 = { "cone", "cycle" }; bool[] value1 = { _smokeData.geometryData.geometryType == GeometryData.GeometryType.CONE, _smokeData.geometryData.geometryType == GeometryData.GeometryType.CYCLE }; geometrySetLine.GetComponent <TwoTypeChooseLineController>().init("geometry", key1, value1); positionSetLine = transform.GetChild(2).gameObject; positionSetLine.SetActive(true); string[] key2 = { "p_x", "p_y", "p_z" }; string[] value2 = { smokeData.geometryData.position.x.ToString(), smokeData.geometryData.position.y.ToString(), smokeData.geometryData.position.z.ToString() }; positionSetLine.GetComponent <ThreeValueSetLineController>().init(key2, value2); cycleSetLine = transform.GetChild(3).gameObject; coneSetLine = transform.GetChild(4).gameObject; cycleSetLine.SetActive(false); coneSetLine.SetActive(false); string[] key5 = new string[3]; string[] value5 = new string[3]; switch (_smokeData.geometryData.geometryType) { case GeometryData.GeometryType.CYCLE: cycleSetLine.SetActive(true); cycleSetLine.GetComponent <OneValueSetLineController>().init("cy_r", ((CycleGeometryData)_smokeData.geometryData).r.ToString()); directionSetLine = transform.GetChild(5).gameObject; directionSetLine.SetActive(true); key5[0] = "cy_x"; key5[1] = "cy_y"; key5[2] = "cy_z"; value5[0] = ((CycleGeometryData)_smokeData.geometryData).direction.x.ToString(); value5[1] = ((CycleGeometryData)_smokeData.geometryData).direction.y.ToString(); value5[2] = ((CycleGeometryData)_smokeData.geometryData).direction.z.ToString(); directionSetLine.GetComponent <ThreeValueSetLineController>().init(key5, value5); break; case GeometryData.GeometryType.CONE: coneSetLine.SetActive(true); string[] key4 = { "co_r", "co_h" }; string[] value4 = { ((ConeGeometryData)_smokeData.geometryData).r.ToString(), ((ConeGeometryData)_smokeData.geometryData).height.ToString() }; coneSetLine.GetComponent <TwoValueSetLineController>().init(key4, value4); directionSetLine = transform.GetChild(5).gameObject; key5[0] = "co_x"; key5[1] = "co_y"; key5[2] = "co_z"; directionSetLine.SetActive(true); value5[0] = ((ConeGeometryData)_smokeData.geometryData).direction.x.ToString(); value5[1] = ((ConeGeometryData)_smokeData.geometryData).direction.y.ToString(); value5[2] = ((ConeGeometryData)_smokeData.geometryData).direction.z.ToString(); directionSetLine.GetComponent <ThreeValueSetLineController>().init(key5, value5); break; default: break; } physicalSetLine0 = transform.GetChild(6).gameObject; physicalSetLine0.SetActive(true); string[] key6 = { "duration", "maxNumber" }; string[] value6 = { smokeData.physicalData.duration.ToString(), smokeData.physicalData.maxNumber.ToString() }; physicalSetLine0.GetComponent <TwoValueSetLineController>().init(key6, value6); physicalSetLine1 = transform.GetChild(7).gameObject; physicalSetLine1.SetActive(true); string[] key7 = { "particle size", "speed" }; string[] value7 = { smokeData.physicalData.particleSize.ToString(), smokeData.physicalData.speed.ToString() }; physicalSetLine1.GetComponent <TwoValueSetLineController>().init(key7, value7); colorSetLine = transform.GetChild(8).gameObject; colorSetLine.SetActive(true); string[] key8 = { "R", "G", "B" }; string[] value8 = { smokeData.color.r.ToString(), smokeData.color.g.ToString(), smokeData.color.b.ToString() }; colorSetLine.GetComponent <ThreeValueSetLineController>().init(key8, value8); }
public override void set(string key, string value) { // Debug.Log(key); // Debug.Log(value); try { if (value != "") { switch (key) { case "smoke type": { if (value == "smoke") { CycleGeometryData cycleGeometryData = new CycleGeometryData( new Vector3(0f, 0.5f, 0f), 0.1f, new Vector3(0f, 0f, 0f) ); PhysicalData physicalData = new PhysicalData( 0.01f, 10.0f, 1000, 3f ); SmokeData newSmokeData = new SmokeData(smokeData.index, smokeData.name, Data.type.SMOKE, true, cycleGeometryData, physicalData, SmokeData.SmokeType.SMOKE, new Color(0, 0, 0)); init(newSmokeData); } else if (value == "fire") { CycleGeometryData cycleGeometryData = new CycleGeometryData( new Vector3(0f, 0.5f, 0f), 0.1f, new Vector3(0f, 0f, 0f) ); PhysicalData physicalData = new PhysicalData( 0.01f, 10.0f, 1000, 3f ); SmokeData newSmokeData = new SmokeData(smokeData.index, smokeData.name, Data.type.SMOKE, true, cycleGeometryData, physicalData, SmokeData.SmokeType.FIRE, new Color(0, 0, 0)); init(newSmokeData); } else if (value == "explosion") { CycleGeometryData cycleGeometryData = new CycleGeometryData( new Vector3(0f, 0.5f, 0f), 0.1f, new Vector3(0f, 0f, 0f) ); PhysicalData physicalData = new PhysicalData( 0.01f, 10.0f, 1000, 3f ); SmokeData newSmokeData = new SmokeData(smokeData.index, smokeData.name, Data.type.SMOKE, true, cycleGeometryData, physicalData, SmokeData.SmokeType.EXPLOSION, new Color(0, 0, 0)); init(newSmokeData); } break; } //key1 { "cone", "cycle"} case "geometry": { if (value == "cone") { ConeGeometryData coneGeometryData = new ConeGeometryData( new Vector3(0f, 0.5f, 0f), 0.1f, 0.1f, new Vector3(0f, 0f, 0f) ); PhysicalData physicalData = new PhysicalData( 0.01f, 10.0f, 1000, 3f ); SmokeData newSmokeData = new SmokeData(smokeData.index, smokeData.name, Data.type.SMOKE, true, coneGeometryData, physicalData, SmokeData.SmokeType.SMOKE, new Color(0, 0, 0)); init(newSmokeData); } else if (value == "cycle") { CycleGeometryData cycleGeometryData = new CycleGeometryData( new Vector3(0f, 0.5f, 0f), 0.1f, new Vector3(0f, 0f, 0f) ); PhysicalData physicalData = new PhysicalData( 0.01f, 10.0f, 1000, 3f ); SmokeData newSmokeData = new SmokeData(smokeData.index, smokeData.name, Data.type.SMOKE, true, cycleGeometryData, physicalData, SmokeData.SmokeType.SMOKE, new Color(0, 0, 0)); init(newSmokeData); } break; } //key2 { "p_x", "p_y", "p_z" } case "p_x": { Vector3 position = new Vector3(float.Parse(value), smokeData.geometryData.position.y, smokeData.geometryData.position.z); smokeData.geometryData.position = position; break; } case "p_y": { Vector3 position = new Vector3(smokeData.geometryData.position.x, float.Parse(value), smokeData.geometryData.position.z); smokeData.geometryData.position = position; break; } case "p_z": { Vector3 position = new Vector3(smokeData.geometryData.position.x, smokeData.geometryData.position.y, float.Parse(value)); smokeData.geometryData.position = position; break; } //key3 { "cy_r" } case "cy_r": { ((CycleGeometryData)smokeData.geometryData).r = float.Parse(value); break; } //key4 { "co_r", "co_h" } case "co_r": { ((ConeGeometryData)smokeData.geometryData).r = float.Parse(value); break; } case "co_h": { ((ConeGeometryData)smokeData.geometryData).height = float.Parse(value); break; } //key5 { "co_x", "co_y", "co_z" } case "co_x": { ((ConeGeometryData)smokeData.geometryData).direction.x = float.Parse(value); break; } case "co_y": { ((ConeGeometryData)smokeData.geometryData).direction.y = float.Parse(value); break; } case "co_z": { ((ConeGeometryData)smokeData.geometryData).direction.y = float.Parse(value); break; } //key5 { "cy_x", "cy_y", "cy_z" } case "cy_x": { ((CycleGeometryData)smokeData.geometryData).direction.x = float.Parse(value); break; } case "cy_y": { ((CycleGeometryData)smokeData.geometryData).direction.y = float.Parse(value); break; } case "cy_z": { ((CycleGeometryData)smokeData.geometryData).direction.y = float.Parse(value); break; } //key6 = { "duration", "maxNumber" }; case "duration": { smokeData.physicalData.duration = float.Parse(value); break; } case "maxNumber": { smokeData.physicalData.maxNumber = int.Parse(value); break; } //key7 = { "particle size", "speed" }; case "particle size": { smokeData.physicalData.particleSize = float.Parse(value); break; } case "speed": { smokeData.physicalData.speed = float.Parse(value); break; } //key8 { "R", "G", "B"} case "R": { Color color = new Color(float.Parse(value), smokeData.color.g, smokeData.color.b); smokeData.color = color; break; } case "G": { Color color = new Color(smokeData.color.r, float.Parse(value), smokeData.color.b); smokeData.color = color; break; } case "B": { Color color = new Color(smokeData.color.r, smokeData.color.g, float.Parse(value)); smokeData.color = color; break; } default: { break; } } } } catch (System.Exception) { } }