Beispiel #1
0
    public static ShaderIndexData createInstance()
    {
        ShaderIndexData sid = AssetDatabase.LoadAssetAtPath <ShaderIndexData>(ASSET_PATH);

        if (null == sid)
        {
            sid = ScriptableObject.CreateInstance <ShaderIndexData>();
            AssetDatabase.CreateAsset(sid, ASSET_PATH);
        }
        sid.shaderIdxList.Clear();
        return(sid);
    }
Beispiel #2
0
    private void loadShader()
    {
        if (null != shaderAB)
        {
            return;
        }
        string shaderPath = Path.Combine(Application.streamingAssetsPath, mobileShader);

#if UNITY_EDITOR
        shaderPath = Path.Combine(Application.streamingAssetsPath, winShader);
#endif
        shaderAB       = AssetBundle.LoadFromFile(shaderPath);
        _shaderIdxData = shaderAB.LoadAsset <ShaderIndexData>("assets/resources/shaders/svc/shader_idx.asset");
    }