Ejemplo n.º 1
0
    static int IntToEnum(IntPtr L)
    {
        int arg0 = (int)LuaDLL.lua_tonumber(L, 1);

        FileSystem.RES_LOCATION o = (FileSystem.RES_LOCATION)arg0;
        ToLua.Push(L, o);
        return(1);
    }
Ejemplo n.º 2
0
 public string LoadString(string path, FileSystem.RES_LOCATION resLocation = FileSystem.RES_LOCATION.auto)
 {
     byte[] bytes = LoadBytes(path, resLocation);
     if (bytes == null)
     {
         return(null);
     }
     return(FileSystem.byte2string(bytes));
 }
Ejemplo n.º 3
0
    public Packet_Bundle(string name, AssetBundle bundle, FileSystem.RES_LOCATION resLocation)
    {
        /*
         * using (StreamWriter sw = new StreamWriter("d:/qkwork/tmp.log", true, Encoding.UTF8))
         * {
         *  sw.Write(DateTime.Now.ToString("[yyyy-MM-dd HH:mm:ss] ") + "装完资源包 " + name + "\r\n");
         * }
         */

        m_Name        = name;
        m_bundle      = bundle;
        m_ResLocation = resLocation;
    }
Ejemplo n.º 4
0
 static int LoadString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         PacketRouting           obj  = (PacketRouting)ToLua.CheckObject(L, 1, typeof(PacketRouting));
         string                  arg0 = ToLua.CheckString(L, 2);
         FileSystem.RES_LOCATION arg1 = (FileSystem.RES_LOCATION)ToLua.CheckObject(L, 3, typeof(FileSystem.RES_LOCATION));
         string                  o    = obj.LoadString(arg0, arg1);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 5
0
 public UnityEngine.Object Load(string path, FileSystem.RES_LOCATION resLocation = FileSystem.RES_LOCATION.auto)
 {
     foreach (IPacket curr in m_packets)
     {
         if (resLocation != FileSystem.RES_LOCATION.auto && curr.ResLocation != resLocation)
         {
             continue;                                                                                //资源所在的域不对
         }
         UnityEngine.Object re       = curr.Load(path);
         BinAsset           binAsset = re as BinAsset;
         if (binAsset != null || re != null)
         {
             return(re);
         }
     }
     return(null);
 }
Ejemplo n.º 6
0
 public byte[] LoadBytes(string path, FileSystem.RES_LOCATION resLocation = FileSystem.RES_LOCATION.auto)
 {
     UnityEngine.Object obj = Load(path, resLocation);
     return(GetBytesFromPacketFile(obj));
 }