Ejemplo n.º 1
0
            public static string Execute(params string[] args)
            {
                MoonController moon = GameObject.FindObjectOfType <MoonController>();

                int masserPhase  = 1;
                int secundaPhase = 1;

                if (!SkyManager.instance.EnhancedSkyCurrentToggle)
                {
                    return("Enhanced Sky Must be enabled to set this");
                }
                else if (args == null || args.Length < 2 || moon == null)
                {
                    return(Wenzil.Console.Commands.HelpCommand.Execute(SetMoonPhases.name));
                }
                else if (!int.TryParse(args[0], out masserPhase) || !int.TryParse(args[1], out secundaPhase))
                {
                    return(Wenzil.Console.Commands.HelpCommand.Execute(SetMoonPhases.name));
                }
                else if (!Enum.IsDefined(typeof(MoonController.MoonPhases), masserPhase) || !Enum.IsDefined(typeof(MoonController.MoonPhases), secundaPhase))
                {
                    return(Wenzil.Console.Commands.HelpCommand.Execute(SetMoonPhases.name));
                }
                else
                {
                    moon.SetPhase((MoonController.MoonPhases)masserPhase, (MoonController.MoonPhases)secundaPhase);
                    return(string.Format("Set moon phases.  Masser phase: {0} Secunda phase: {1}", moon.MasserPhase.ToString(), moon.SecundaPhase.ToString()));
                }
            }
Ejemplo n.º 2
0
            public static string Execute(params string[] args)
            {
                MoonController moon = GameObject.FindObjectOfType <MoonController>();

                if (!SkyManager.instance.EnhancedSkyCurrentToggle || moon == null)
                {
                    return("Enhanced Sky Must be enabled to set this");
                }
                else
                {
                    moon.autoUpdatePhase = !moon.autoUpdatePhase;
                    return(string.Format("Toggled moon phase updates; current state: {0} ", moon.autoUpdatePhase));
                }
            }