public void Awake() { dayOffsetFrames = sim.m_dayTimeOffsetFrames; SimulationManager.RegisterSimulationManager(this); speed = new Fraction(){num=1,den=1}; LoadData(); }
void LoadData() { byte[] data = sim.m_SerializableDataWrapper.LoadData("TimeWarp"); if (data != null) { try { Settings settings = (Settings)(new BinaryFormatter()).Deserialize(new MemoryStream(data)); speed = settings.speed; dayOffsetFrames = settings.dayOffsetFrames; DayNightProperties.instance.m_Longitude = settings.longitude; DayNightProperties.instance.m_Latitude = settings.lattitude; DayNightProperties.instance.m_SunIntensity = settings.sunIntensity; DayNightProperties.instance.m_SunSize = settings.sunSize; } catch (Exception e) { Debug.Log("Error loading timewarp settings: " + e); } } }