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

        resources.Values.forEach((res, i) => ret[i] = res);
        return(ret);
    }
Exemple #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();
        }
    }
Exemple #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));
    }
Exemple #4
0
    GameObject specialInstantiate(IGameObjectResource res)
    {
        GameObject childObj = getChildGameObj(res.prefab);

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