Пример #1
0
        protected override bool Handle(ArgumentsList args, OptionsList opts)
        {
            if (args.Contains("set"))
            {
                logger.Log($"TimeScale change from {Time.timeScale} to: {args["set"]}");
                Time.timeScale = args["set"];
            }
            else
            {
                logger.Log($"The current timescale of game is: {Time.timeScale}");
            }

            return(true);
        }
Пример #2
0
        protected override bool Handle(ArgumentsList args, OptionsList opts)
        {
            if (args.Contains("set"))
            {
                Physics.gravity = Vector3.down * args["set"];
                logger.Log($"Enviroment gravity changed to: {-args["set"]}");
            }
            else
            {
                logger.Log($"The value of environment gravity is: {Physics.gravity}");
            }

            return(true);
        }
Пример #3
0
        protected override bool Handle(ArgumentsList args, OptionsList opts)
        {
            if (args.Contains("set"))
            {
                if (opts.Contains("player"))
                {
                    foreach (var player in GameObject.FindObjectsOfType <PlayerMovement>())
                    {
                        player.Gravity = -args["set"];
                    }

                    logger.Log($"All players in scene have gravity changed to: {-args["set"]}");
                }

                if (opts.Contains("environment") || opts.Count == 0)
                {
                    Physics.gravity = Vector3.down * args["set"];
                    logger.Log($"Enviroment gravity changed to: {-args["set"]}");
                }
            }
            else
            {
                if (opts.Contains("player"))
                {
                    foreach (var player in GameObject.FindObjectsOfType <PlayerMovement>())
                    {
                        logger.Log($"The value of gravity from player {player.transform.name} is: {player.Gravity}");
                    }
                }


                if (opts.Contains("environment") || opts.Count == 0)
                {
                    logger.Log($"The value of environment gravity is: {Physics.gravity}");
                }
            }

            return(true);
        }