public void Play() { if (isPlaying) { C_DebugHelper.LogWarning("Sequence is already playing" + gameObject); return; } if (cutscenes.Count == 0) { C_DebugHelper.LogError("No Cutscenes provided" + gameObject); return; } isPlaying = true; currentIndex = 0; MoveNext(); }
public void InitMainAssetBundleManifest() { try { string filePath = LocalPath.LocalPackagingResources + LocalPath.PackagingResources; if (File.Exists(filePath)) { AssetBundle manifestBundle = AssetBundle.LoadFromFile(filePath); if (manifestBundle != null) { m_AssetBundleManifest = (AssetBundleManifest)manifestBundle.LoadAsset("AssetBundleManifest"); manifestBundle.Unload(false); } } } catch (Exception e) { C_DebugHelper.LogWarning(" GameResMgr InitMainAssetBundleManifest : " + e); } }
private string Search(string matchContent = "") { List <string> ResList = new List <string>(); if (!string.IsNullOrEmpty(matchContent)) { string[] data = matchContent.Split('\n'); for (int id = 0; id < data.Length; id++) { ResList.Add(data[id]); } } string content = ""; string mark = "PackagingResources"; for (int i = 0; i < cutscenes.Count; i++) //所有剧情 { Cutscene cutscene = cutscenes[i]; //单个剧情 if (cutscene != null) { for (int ii = 0; ii < cutscene.groups.Count; ii++)//单个剧情的所有轨道 { string[] fileName = cutscene.name.Split('_'); if (fileName.Length < 1) { C_DebugHelper.LogError(string.Format("'{0}'名字不规范 要求类似iuv_cam001 ", cutscene.name)); continue; } if (cutscene.name.Contains("(Clone)")) { int end = name.LastIndexOf("(Clone)"); cutscene.name = cutscene.name.Substring(0, (end == -1 ? cutscene.name.Length : end)); } if (cutscene.name.Contains("(clone)")) { int end = name.LastIndexOf("(clone)"); cutscene.name = cutscene.name.Substring(0, (end == -1 ? cutscene.name.Length : end)); } string dirpath = fileName[0] + "/prefabs/" + cutscene.name + "/" + cutscene.name; ContainContent(dirpath, ResList); //收集cutscene string cutscenepath = fileName[0] + "/cutscene/" + cutscene.name; ContainContent(cutscenepath, ResList); //初始化镜头的所有对象 cutscene.LoadAffectedResEditor(); //对象prefab var actor = cutscene.groups[ii].actor; if (actor == null) { C_DebugHelper.LogWarning("对象:" + dirpath + " actor is null"); } if (actor != null && PrefabUtility.GetPrefabType(actor) == PrefabType.Prefab) { string tempActorName = AssetDatabase.GetAssetPath(actor); tempActorName = tempActorName.Substring(tempActorName.IndexOf(mark) + mark.Length + 1); string temp = C_String.DeleteExpandedName(tempActorName).ToLower(); ContainContent(temp, ResList); } //所有的轨道上资源对象 List <CutsceneTrack> cutsceneTrack = cutscene.groups[ii].tracks; if (cutsceneTrack != null) { for (int iii = 0; iii < cutsceneTrack.Count; iii++) { string path = cutsceneTrack[iii].GetAffectResPath(); string pathTemp = C_String.DeleteExpandedName(path).ToLower(); ContainContent(pathTemp, ResList); List <ActionClip> _actionClips = cutsceneTrack[iii].actionClips; for (int j = 0; j < _actionClips.Count; j++) { string clipPath = _actionClips[j].GetAffectResPath(); string clipPathTemp = C_String.DeleteExpandedName(clipPath).ToLower(); ContainContent(clipPathTemp, ResList); } } } } } } //C_DebugHelper.Log("资源:+" + content); content = ""; //清理重复的名字资源 for (int i = 0; i < ResList.Count; i++) { content += ResList[i] + "\n"; } return(content); }