Example #1
0
 private void LoadAgents()
 {
     Object[] objs = AssetUtil.Load(@"Prefabs\Agents");
     for (int i = 0; i < objs.Length; i++)
     {
         GameObject  go       = objs[i] as GameObject;
         AgentRemote remote   = go.GetComponent <AgentRemote>();
         int         hashCode = remote.Type.GetHashCode();
         AgentPrefabs[hashCode] = remote;
     }
 }
Example #2
0
 static int Load(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         AssetUtil          obj  = (AssetUtil)ToLua.CheckObject <AssetUtil>(L, 1);
         string             arg0 = ToLua.CheckString(L, 2);
         UnityEngine.Object o    = obj.Load(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }