Ejemplo n.º 1
0
        public static IEnumerator hack()
        {
            for (int i = 0; i < 5; i++)
            {
                Devconsole.PushMessage("initializing...");
                yield return(new WaitForSeconds(.2f));
            }

            for (int i = 0; i < 50; i++)
            {
                Devconsole.PushMessage("hacking...", i % 2 == 0 ? Devconsole.outputColor : Devconsole.commandColor);
                yield return(new WaitForSeconds(.05f));
            }

            Devconsole.PushMessage("You've been hacked!", Devconsole.errorColor);
            yield return(new WaitForSeconds(.5f));

            Devconsole.PushMessage("(Not really, dont worry)", Devconsole.successColor);
            yield return(new WaitForSeconds(2.5f));

            Devconsole.PushMessage("Unless?", Devconsole.errorColor);
            yield return(new WaitForSeconds(.5f));

            Devconsole.Clear();
        }
Ejemplo n.º 2
0
        public static void color(Color col)
        {
            var c = new UnityEngine.Color(1, 0, 0);

            if (col == Color.Green)
            {
                c = new UnityEngine.Color(0, 1, 0);
            }
            if (col == Color.Blue)
            {
                c = new UnityEngine.Color(0, 0, 1);
            }
            Devconsole.PushMessage(col.ToString(), c);
        }
Ejemplo n.º 3
0
        public void OnValueChange()
        {
            var text = field.text;

            if (!tabbing)
            {
                currentParamaterText = Devconsole.GetArgumentValue(text);
            }
            if (!suggestions.gameObject.activeSelf)
            {
                return;
            }

            suggestions.customPosition = new Vector2(text == "" ? 0 : field.preferredWidth, 30);
            var choices = completionProvider?.Invoke(field.text);

            suggestions.SetChoices(choices?.Where(v => currentParamaterText == "" || v.ToLower().Contains(currentParamaterText)).ToArray(), Devconsole.GetArgumentName(text));
        }
Ejemplo n.º 4
0
 public static void echo(string[] args) => Devconsole.PushMessage(string.Join(" ", args));
Ejemplo n.º 5
0
        public static void imageEmbed()
        {
            var img = Devconsole.InstantiateInConsole(Resources.Load <GameObject>("consoleImage"));

            Devconsole.PushComponent(img);
        }