Exemplo n.º 1
0
    private IEnumerator doJoystick()
    {
        var moveJoyStick = (LuaTable)uiBattleAPI["moveJoyStick"];

        while (true)
        {
            var axis = (Vector2)moveJoyStick["inputAxis"];

            if (localPlayerController.group == 1)
            {
                localPlayerController.SetVelocity(new Vector3(axis.x, 0, axis.y));
            }
            else
            {
                localPlayerController.SetVelocity(new Vector3(-axis.x, 0, -axis.y));
            }

            yield return(null);
        }
    }
 static int SetVelocity(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         NTGBattlePlayerController obj  = (NTGBattlePlayerController)ToLua.CheckObject(L, 1, typeof(NTGBattlePlayerController));
         UnityEngine.Vector3       arg0 = ToLua.ToVector3(L, 2);
         bool arg1 = LuaDLL.luaL_checkboolean(L, 3);
         obj.SetVelocity(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }