Ejemplo n.º 1
0
        public LSL_Integer aaWindlightAddDayCycleFrame (LSL_Float dayCyclePosition, int dayCycleFrameToCopy)
        {
            IEnvironmentSettingsModule environmentSettings = World.RequestModuleInterface<IEnvironmentSettingsModule> ();
            if (environmentSettings == null)
                return LSL_Integer.FALSE;

            WindlightDayCycle cycle = environmentSettings.GetCurrentDayCycle ();
            if (cycle == null)
                return LSL_Integer.FALSE;

            if (cycle.Cycle.IsStaticDayCycle || dayCycleFrameToCopy >= cycle.Cycle.DataSettings.Count)
                return LSL_Integer.FALSE;

            var data = cycle.Cycle.DataSettings.Keys.ToList ();
            cycle.Cycle.DataSettings.Add (dayCyclePosition.ToString (),
                                         cycle.Cycle.DataSettings [data [dayCycleFrameToCopy]]);
            environmentSettings.SetDayCycle (cycle);

            return LSL_Integer.TRUE;
        }