Пример #1
0
    public UNResourceObject Load(string resName, ResourceType resType, ResourceCleanType resCleanType = ResourceCleanType.Count)
    {
        var resObj = GetFromObjects(resName, resType, resCleanType);

        if (resObj != null)
        {
            return(resObj);
        }
        // 取更新文件 用assetsbundle
        var path = GetPath_Update(resType);

        if (resObj != null)
        {
            return(resObj);
        }
        // 取非更新文件 用resource.load
        path = GetPath(resType);
        var obj = Resources.Load(path);
        var ins = Object.Instantiate(obj);

        obj    = null;
        resObj = UNResourceObject.New(ins, resName, resType, resCleanType);
        AddToObjects(resObj);
        return(resObj);
    }
Пример #2
0
    private void AddToObjects(Object obj, string resName, ResourceType resType, ResourceCleanType resCleanType = ResourceCleanType.Count)
    {
        var robj = UNResourceObject.New(obj, resName, resType, resCleanType);

        AddToObjects(robj);
    }