コード例 #1
0
 public void Get(string url, Action <string, GameObject> callback)
 {
     assetPool.GetAsset(url, prefab => {
         if (prefab == null)
         {
             callback(url, null);
         }
         else
         {
             GameObject o = instancePool.RemoveOne(url);
             if (o == null)
             {
                 o = Object.Instantiate(prefab);
             }
             else
             {
                 o.transform.SetLocal(prefab.transform);
             }
             o.SetActive(true);
             callback(url, o);
         }
     });
 }