Пример #1
0
        // <tag>+spwalk <x>, <time>
        // +spwalk <tag>, <x>, <time>
        public IEnumerator SpWalkTo(string tag, string[] args)
        {
            string spTag;
            float  distance, time, x;

            NArgsAssert(args.Length >= 2);

            if (!string.IsNullOrEmpty(tag))
            {
                spTag = tag;
            }
            else
            {
                spTag = args[0];
                args  = args.Skip(1).ToArray();
            }
            var npc = this[spTag];

            if (npc == null)
            {
                throw new NRuntimeException($"NPC tag:{tag} は存在しません.");
            }

            NArgsAssert(args.Length == 2);

            x    = NovelHelper.TryParse(args[0]);
            time = NovelHelper.TryParse(args[1]);

            yield return(Walk(npc, x - npc.transform.position.x, time));
        }
Пример #2
0
 public IEnumerator Stop(string t, string[] a)
 {
     if (a.Length == 0)
     {
         Stop();
     }
     else
     {
         float i = NovelHelper.TryParse(NovelHelper.CombineAll(a));
         yield return(Stop(i));
     }
 }
Пример #3
0
        public IEnumerator SwitchToFreeCamera(string _, string[] args)
        {
            if (args.Length < 2)
            {
                throw new NRuntimeException("引数が足りません.");
            }
            var x = NovelHelper.TryParse(args[0]);
            var y = NovelHelper.TryParse(args[1]);

            SwitchToFreeCamera(x, y);
            yield break;
        }
Пример #4
0
        // <tag>+spofs <x>, <y>
        // +spofs <tag>, <x>, <y>
        public IEnumerator SpOfs(string tag, string[] args)
        {
            string spTag;

            NArgsAssert(args.Length >= 2);
            if (!string.IsNullOrEmpty(tag))
            {
                spTag = tag;
            }
            else
            {
                spTag = args[0];
                args  = args.Skip(1).ToArray();
            }
            NArgsAssert(args.Length == 2);
            var x = NovelHelper.TryParse(args[0]);
            var y = NovelHelper.TryParse(args[1]);

            SpOfs(spTag, new Vector2(x, y));
            yield break;
        }
Пример #5
0
        // +spset <tag>, <charId>[, <x>, <y>]
        public IEnumerator SpSet(string _, string[] args)
        {
            if (args.Length < 2)
            {
                throw new NRuntimeException("引数が足りません.");
            }
            var spTag = args[0];
            var id    = args[1];
            var pos   = Vector2.zero;

            if (args.Length > 2)
            {
                if (args.Length > 4)
                {
                    throw new NRuntimeException("引数が多すぎます.");
                }

                pos.x = NovelHelper.TryParse(args[2]);
                pos.y = NovelHelper.TryParse(args[3]);
            }
            SpSet(spTag, id, pos);
            yield break;
        }