Example #1
0
    public IGameObjectResource[] snapshot()
    {
        var ret = new IGameObjectResource[resources.Count];

        resources.Values.forEach((res, i) => ret[i] = res);
        return(ret);
    }
Example #2
0
    public void unloadObject(IGameObjectResource res)
    {
        var _res = res as GameObjectResource;

        if (_res != null && resources.Remove(res.name))
        {
            _res._prefab  = null;
            _res.requests = null;
            onResourceUnload(res);
            //ResourceManager.inst.hintUnloadUnusedAssets();
        }
    }
Example #3
0
    protected virtual GameObject doInstantiate(IGameObjectResource res, GameObject proxy, bool worldPositionStays)
    {
        Transform parent = null;

        if (!Object.ReferenceEquals(proxy, null))
        {
            if (proxy != null)
            {
                parent = proxy.transform;
            }
            else
            {
                return(null);
            }
        }
        return(Instantiate <GameObject>(res.prefab, parent, worldPositionStays));
    }
Example #4
0
    GameObject specialInstantiate(IGameObjectResource res)
    {
        GameObject childObj = getChildGameObj(res.prefab);

        return(Instantiate <GameObject>(childObj, Vector3.zero, new Quaternion()));
    }
Example #5
0
 protected override void onResourceUnload(IGameObjectResource res)
 {
     policy.unload(res);
 }
Example #6
0
 protected override void onResourceRequest(IGameObjectResource res)
 {
     policy.request(res);
 }
Example #7
0
 protected virtual void onResourceUnload(IGameObjectResource res)
 {
 }
Example #8
0
 protected virtual void onResourceRequest(IGameObjectResource res)
 {
 }