Ejemplo n.º 1
0
 private void setWeather(WeatherType weather)
 {
     this.currentWeather = weather;
     if (currentWeather == WeatherType.Clear)
     {
         skyboxMat          = RAKUtilities.getMaterial(RAKUtilities.MATERIAL_SKYBOX_SUNSET);
         skyboxMat.color    = new Color32(164, 164, 164, 196);
         skyboxExposure     = 1f;
         windAudio.volume   = 0;
         windZone.windMain  = 0;
         audioSource.volume = 0;
     }
     else if (currentWeather == WeatherType.Overcast)
     {
         skyboxMat          = RAKUtilities.getMaterial(RAKUtilities.MATERIAL_SKYBOX_SUNSET);
         skyboxMat.color    = new Color32(184, 255, 193, 202);
         skyboxExposure     = 1.28f;
         windAudio.volume   = .2f;
         audioSource.volume = .4f;
         windZone.mode      = WindZoneMode.Directional;
         windZone.windMain  = 1;
     }
     else if (currentWeather == WeatherType.DownPour)
     {
         skyboxMat          = RAKUtilities.getMaterial(RAKUtilities.MATERIAL_SKYBOX_SUNSET);
         skyboxMat.color    = new Color32(164, 164, 164, 196);
         skyboxExposure     = 1;
         windAudio.volume   = .5f;
         audioSource.volume = .8f;
         windZone.mode      = WindZoneMode.Spherical;
         windZone.windMain  = 2;
     }
     if (currentWeather != WeatherType.Clear)
     {
         generateClouds(masterTerrain.transform, masterTerrain.getTerrain(), currentWeather);
         audioSource.Play();
     }
     else
     {
         clouds = new RAKCloud[0];
     }
     windAudio.Play();
     skyboxMat.SetFloat("_Exposure", skyboxExposure);
     RenderSettings.skybox = skyboxMat;
     DynamicGI.UpdateEnvironment();
 }
Ejemplo n.º 2
0
 public static void SetPropertiesForParticleSystemByCreature(ParticleSystem ps, Creature creature)
 {
     ps.Stop();
     if (creature.getSpecies().getBaseSpecies() == BASE_SPECIES.Gnat)
     {
         ParticleSystem.MainModule main = ps.main;
         main.duration      = .3f;
         main.loop          = false;
         main.prewarm       = false;
         main.startDelay    = 0;
         main.startLifetime = .3f;
         main.startSpeed    = new ParticleSystem.MinMaxCurve(10, 20);
         main.startSize     = .1f;
         main.startColor    = Color.yellow;
         ParticleSystem.EmissionModule emission = ps.emission;
         emission.rateOverTime     = 750;
         emission.rateOverDistance = 0;
         ParticleSystem.ShapeModule shape = ps.shape;
         shape.shapeType             = ParticleSystemShapeType.Donut;
         shape.radius                = 1;
         shape.donutRadius           = .2f;
         shape.radiusThickness       = 1;
         shape.arc                   = 360;
         shape.arcMode               = ParticleSystemShapeMultiModeValue.BurstSpread;
         shape.arcSpread             = 0;
         shape.rotation              = new Vector3(90, 0, 0);
         shape.scale                 = new Vector3(.4f, .4f, 1);
         shape.randomDirectionAmount = 1;
         ParticleSystemRenderer renderer = ps.GetComponent <ParticleSystemRenderer>();
         renderer.renderMode      = ParticleSystemRenderMode.Stretch;
         renderer.normalDirection = 1;
         renderer.material        = RAKUtilities.getMaterial("GnatSpark");
         renderer.sortMode        = ParticleSystemSortMode.YoungestInFront;
         renderer.minParticleSize = .01f;
         renderer.maxParticleSize = .05f;
         renderer.lengthScale     = .2f;
     }
 }