Example #1
0
        public void Awake()
        {
            dayOffsetFrames = sim.m_dayTimeOffsetFrames;
            SimulationManager.RegisterSimulationManager(this);
            speed = new Fraction(){num=1,den=1};

            LoadData();
        }
Example #2
0
        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);
                }
            }
        }