少年修仙传客户端代码仓库
client_Wu Xijin
2019-05-08 d32cc3dcba1d8d39b11152f19c4858aa7c83fa7f
Core/ResModule/VideoLoader.cs
@@ -12,7 +12,7 @@
        if (Application.isEditor)
        {
#if UNITY_EDITOR
            var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, "Movie/", name, ".mp4");
            var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, "Video/", name, ".mp4");
            mp4 = UnityEditor.AssetDatabase.LoadAssetAtPath<VideoClip>(path);
            if (mp4 == null)
            {
@@ -22,35 +22,11 @@
        }
        else
        {
            var assetInfo = new AssetInfo("movie", name);
            var assetInfo = new AssetInfo("video", name);
            mp4 = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as VideoClip;
        }
        return mp4;
    }
    public static GameObject LoadPlayer()
    {
        GameObject prefab = null;
        if (Application.isEditor)
        {
#if UNITY_EDITOR
            var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, "Movie/MoviePlayer.prefab");
            prefab = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(path);
#endif
        }
        else
        {
            var assetInfo = new AssetInfo("movie", "MoviePlayer");
            prefab = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as GameObject;
        }
        if (prefab == null)
        {
            DebugEx.LogError("VideoLoader.LoadPlayer() => 加载不到资源: MoviePlayer.");
        }
        return prefab;
    }
}