public void Load(System.IO.FileStream fs) { var data = new byte[24]; fs.Read(data, 0, data.Length); newWindVector = new Vector2(System.BitConverter.ToSingle(data, 0), System.BitConverter.ToSingle(data, 4)); windVector = new Vector2(System.BitConverter.ToSingle(data, 8), System.BitConverter.ToSingle(data, 12)); windTimer = System.BitConverter.ToSingle(data, 20); vegetationShaderWindPropertyID = Shader.PropertyToID("_Windpower"); float windPower = windVector.magnitude; Shader.SetGlobalFloat(vegetationShaderWindPropertyID, windPower); if (WindUpdateEvent != null) { WindUpdateEvent(windVector); } skyboxMaterial = RenderSettings.skybox; gmap = GameMaster.realMaster.globalMap; SetEnvironment(gmap.GetCurrentEnvironment()); RecalculateCelestialDecorations(); prepared = true; }