Пример #1
0
            public LuaArgs setVisible(LuaArgs args)
            {
                var visible = args.GetBool(0);

                m_entity.Visible = visible;
                return(LuaArgs.Empty);
            }
Пример #2
0
            public LuaArgs setCastShadows(LuaArgs args)
            {
                var castShadows = args.GetBool(0);

                m_entity.CastShadows = castShadows;
                return(LuaArgs.Empty);
            }
Пример #3
0
            public LuaArgs startParticles(LuaArgs args)
            {
                var path        = args.GetString(0);
                var startActive = args.IsNil(1) ? false : args.GetBool(1);

                m_entity.StartParticles(path, startActive);
                return(LuaArgs.Empty);
            }
Пример #4
0
            public LuaArgs playSound(LuaArgs args)
            {
                var path = args.GetString(0);
                var loop = args.IsNil(1) ? false : args.GetBool(1);

                m_entity.PlaySound(path, loop);
                return(LuaArgs.Empty);
            }
Пример #5
0
        public LuaArgs showDialogue(LuaArgs args)
        {
            var character = args.GetString(0);
            var dialogue  = args.GetString(1);
            var modal     = args.IsNil(2) ? true : args.GetBool(2);

            m_state.ShowDialogue(character, dialogue, modal);
            return(LuaArgs.Empty);
        }
Пример #6
0
        public LuaArgs playMusic(LuaArgs args)
        {
            var path       = args.IsNil(0) ? null : args.GetString(0);
            var loop       = args.IsNil(1) ? true : args.GetBool(1);
            var transition = args.IsNil(2) ? 1.0f : args.GetFloat(2);

            if (transition < 0.0f)
            {
                throw new LuaError("Transition duration must be positive");
            }
            m_state.PlayMusic(path, transition, loop);
            return(LuaArgs.Empty);
        }
Пример #7
0
            public LuaArgs playAnimation(LuaArgs args)
            {
                var path        = args.GetString(0);
                var animateRoot = args.IsNil(1) ? true : args.GetBool(1);

                if (LuaAnimation.Exists(path))
                {
                    var anim = LuaAnimation.Get(path);
                    m_entity.StartAnimation(anim, animateRoot);
                    return(LuaArgs.Empty);
                }
                else
                {
                    throw new LuaError(string.Format("No such animation: {0}", path));
                }
            }
Пример #8
0
 public LuaArgs mount(LuaArgs args)
 {
     try
     {
         var mount    = args.GetObject <LuaMount>(0);
         var path     = new FilePath(args.GetString(1));
         var subPath  = args.IsNil(2) ? FilePath.Empty : new FilePath(args.GetString(2));
         var readOnly = args.IsNil(3) ? false : args.GetBool(3);
         m_fileSystem.Mount(mount, path, subPath, readOnly);
         return(LuaArgs.Empty);
     }
     catch (IOException e)
     {
         throw new LuaError(e.Message);
     }
 }
Пример #9
0
 public LuaArgs setTweakDisabled(LuaArgs args)
 {
     m_state.TweakDisabled = args.GetBool(0);
     return(LuaArgs.Empty);
 }
Пример #10
0
 public LuaArgs setRemoveDisabled(LuaArgs args)
 {
     m_state.RemoveDisabled = args.GetBool(0);
     return(LuaArgs.Empty);
 }
Пример #11
0
 public LuaArgs setFastForwardDisabled(LuaArgs args)
 {
     m_state.FastForwardDisabled = args.GetBool(0);
     return(LuaArgs.Empty);
 }
Пример #12
0
 public LuaArgs setPlayDisabled(LuaArgs args)
 {
     m_state.PlayDisabled = args.GetBool(0);
     return(LuaArgs.Empty);
 }