Пример #1
0
        public static CriAtomEx.CueInfo[] GetCueInfoList(CriAtomCueSheet cueSheet)
        {
            if (string.IsNullOrEmpty(cueSheet.name))
            {
                return(null);
            }

            CriAtomEx.CueInfo[] result = null;

            while (!CriFsPlugin.isInitialized || !CriAtomPlugin.isInitialized)
            {
                Debug.Log("Sleep");
                Thread.Sleep(1000);
            }

            try
            {
                var acb = CriAtomExAcb.LoadAcbFile(null,
                                                   Path.Combine(Application.streamingAssetsPath, cueSheet.acbFile),
                                                   Path.Combine(Application.streamingAssetsPath, cueSheet.awbFile));
                if (acb != null)
                {
                    result = acb.GetCueInfoList();
                    acb.Dispose();
                }
            }
            catch (Exception e)
            {
                Debug.unityLogger.LogException(e);
            }

            return(result);
        }
Пример #2
0
    public CriAtomCueSheet AddCueSheetInternal(string name, string acbFile, string awbFile, CriFsBinder binder)
    {
        var cueSheets = new CriAtomCueSheet[this.cueSheets.Length + 1];

        this.cueSheets.CopyTo(cueSheets, 0);
        this.cueSheets = cueSheets;

        var cueSheet = new CriAtomCueSheet();

        this.cueSheets[this.cueSheets.Length - 1] = cueSheet;
        if (String.IsNullOrEmpty(name))
        {
            cueSheet.name = Path.GetFileNameWithoutExtension(acbFile);
        }
        else
        {
            cueSheet.name = name;
        }
        cueSheet.acbFile = acbFile;
        cueSheet.awbFile = awbFile;
        if (Application.isPlaying)
        {
            cueSheet.acb = this.LoadAcbFile(binder, acbFile, awbFile);
        }
        return(cueSheet);
    }
Пример #3
0
    private IEnumerator LoadAcbDataCoroutine(CriAtomCueSheet cueSheet, byte[] acbData, CriFsBinder awbBinder, string awbPath)
    {
        if (!String.IsNullOrEmpty(awbPath))
        {
            if ((awbBinder == null) && CriWare.IsStreamingAssetsPath(awbPath))
            {
                awbPath = Path.Combine(CriWare.streamingAssetsPath, awbPath);
            }
        }

        while (this.acfIsLoading)
        {
            yield return(new WaitForEndOfFrame());
        }

        using (var async = CriAtomExAcbAsync.LoadAcbData(acbData, awbBinder, awbPath)) {
            cueSheet.async = async;
            while (true)
            {
                var status = async.GetStatus();
                if (status == CriAtomExAcbAsync.Status.Complete)
                {
                    cueSheet.acb = async.MoveAcb();
                    break;
                }
                else if (status == CriAtomExAcbAsync.Status.Error)
                {
                    break;
                }
                yield return(new WaitForEndOfFrame());
            }
            cueSheet.async = null;
        }
    }
Пример #4
0
    public void RemoveCueSheetInternal(string name)
    {
        int index = -1;

        for (int i = 0; i < this.cueSheets.Length; i++)
        {
            if (name == this.cueSheets[i].name)
            {
                index = i;
            }
        }
        if (index < 0)
        {
            return;
        }

        var cueSheet = this.cueSheets[index];

        if (cueSheet.acb != null)
        {
            cueSheet.acb.Dispose();
            cueSheet.acb = null;
        }

        var cueSheets = new CriAtomCueSheet[this.cueSheets.Length - 1];

        Array.Copy(this.cueSheets, 0, cueSheets, 0, index);
        Array.Copy(this.cueSheets, index + 1, cueSheets, index, this.cueSheets.Length - index - 1);
        this.cueSheets = cueSheets;
    }
Пример #5
0
        private SoundSheet GetSoundSheet(CueInfo cueInfo)
        {
            if (cueInfo == null)
            {
                return(null);
            }

            var assetPath  = cueInfo.CueSheetPath;
            var soundSheet = managedSoundSheets.GetValueOrDefault(assetPath);

            if (soundSheet == null)
            {
                // パス情報生成.
                var acbPath = SoundSheet.AcbPath(assetPath);
                var awbPath = SoundSheet.AwbPath(assetPath);

                // ACBファイルのロード.
                CriAtomCueSheet cueSheet = null;

                try
                {
                    cueSheet = CriAtom.AddCueSheet(assetPath, acbPath, awbPath);
                }
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                    return(null);
                }

                if (cueSheet.acb == null)
                {
                    return(null);
                }

                // ロードしたACBを保持した状態で再生成.
                soundSheet = new SoundSheet(assetPath, cueSheet.acb);

                managedSoundSheets.Add(soundSheet.AssetPath, soundSheet);

                var builder = new StringBuilder();

                builder.AppendFormat("Load : {0} : {1}", cueInfo.Cue, cueInfo.CueId).AppendLine();
                builder.AppendLine();
                builder.AppendFormat("Cue : {0}", cueInfo.Cue).AppendLine();
                builder.AppendFormat("CueId : {0}", cueInfo.CueId).AppendLine();
                builder.AppendFormat("FileName : {0}", Path.GetFileName(acbPath)).AppendLine();

                if (!string.IsNullOrEmpty(cueInfo.Summary))
                {
                    builder.AppendFormat("Summary: {0}", cueInfo.Summary).AppendLine();
                }

                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, builder.ToString());
            }

            return(soundSheet);
        }
Пример #6
0
    private void LoadAcbFileAsync(CriAtomCueSheet cueSheet, CriFsBinder binder, string acbFile, string awbFile, bool loadAwbOnMemory)
    {
        if (String.IsNullOrEmpty(acbFile))
        {
            return;
        }

        StartCoroutine(LoadAcbFileCoroutine(cueSheet, binder, acbFile, awbFile, loadAwbOnMemory));
    }
 public CriLiveSoundPlayer(MonoBehaviour owner, CriSoundLiveSettings settings)
 {
     // intiailize
     this.cueSheet  = new CriAtomCueSheet();
     this.bgmSource = owner.gameObject.AddComponent <CriAtomSource>();
     this.seSource  = owner.gameObject.AddComponent <CriAtomSource>();
     this.settings  = settings;
     // set low latency mode
     seSource.androidUseLowLatencyVoicePool = true;
 }
Пример #8
0
    /**
     * <summary>キューシートの追加(メモリからの読み込み)</summary>
     * <param name="name">キューシート名</param>
     * <param name="acbData">ACBデータ</param>
     * <param name="awbFile">AWBファイルパス</param>
     * <param name="awbBinder">AWB用バインダオブジェクト(オプション)</param>
     * <returns>キューシートオブジェクト</returns>
     * \par 説明:
     * 引数に指定したデータとファイルパス情報からキューシートの追加を行います。<br/>
     * 同時に複数のキューシートを登録することが可能です。<br/>
     * <br/>
     * ファイルパスに対して相対パスを指定した場合は StreamingAssets フォルダからの相対でファイルをロードします。<br/>
     * 絶対パス、あるいはURLを指定した場合には指定したパスでファイルをロードします。<br/>
     * <br/>
     * CPKファイルにパッキングされたAWBファイルからキューシートを追加する場合は、
     * awbBinder引数にCPKをバインドしたバインダを指定してください。<br/>
     * なお、バインダ機能はADX2LEではご利用になれません。<br/>
     */
    public static CriAtomCueSheet AddCueSheet(string name, byte[] acbData, string awbFile, CriFsBinder awbBinder = null)
    {
        CriAtomCueSheet cueSheet = CriAtom.instance.AddCueSheetInternal(name, "", awbFile, awbBinder);

        if (Application.isPlaying)
        {
            cueSheet.acb = CriAtom.instance.LoadAcbData(acbData, awbBinder, awbFile);
        }
        return(cueSheet);
    }
Пример #9
0
        public static bool RemoveCueSheet(CriAtomCueSheet cueSheet)
        {
            if (cueSheet == null || string.IsNullOrEmpty(cueSheet.name))
            {
                return(false);
            }

            CriAtom.RemoveCueSheet(cueSheet.name);
            return(true);
        }
Пример #10
0
        // Token: 0x060159D5 RID: 88533 RVA: 0x005807B4 File Offset: 0x0057E9B4
        private bool GetCueInfo(string sheetName, string cueName, out CriAtomEx.CueInfo cueInfo)
        {
            cueInfo = default(CriAtomEx.CueInfo);
            CriAtomCueSheet cueSheet = CriAtom.GetCueSheet(sheetName);

            if (cueSheet == null)
            {
                global::Debug.LogError(string.Format("Failed to get cue sheet: {0}", sheetName));
                return(false);
            }
            return(cueSheet.acb.GetCueInfo(cueName, out cueInfo));
        }
Пример #11
0
 // Token: 0x060159CF RID: 88527 RVA: 0x005806AC File Offset: 0x0057E8AC
 public void CRIAddCueSheet(string sheetName, string acbFullPath, string awbFullPath)
 {
     if (CriAtom.GetCueSheet(sheetName) == null)
     {
         CriAtomCueSheet criAtomCueSheet = CriAtom.AddCueSheet(sheetName, acbFullPath, awbFullPath, null);
         if (criAtomCueSheet == null || (criAtomCueSheet.acbFile == string.Empty && criAtomCueSheet.awbFile == string.Empty))
         {
             global::Debug.LogError(string.Format("Failed to add cue sheet: sheetName={0}, acbFullPath={1}, awbFullPath={2}", sheetName, acbFullPath, awbFullPath));
             this.CRIRemoveCueSheet(sheetName);
         }
     }
 }
Пример #12
0
 /**
  * <summary>非同期でのキューシートの追加(メモリからの読み込み)</summary>
  * <param name='name'>キューシート名</param>
  * <param name='acbData'>ACBデータ</param>
  * <param name='awbFile'>AWBファイルパス</param>
  * <param name='awbBinder'>AWB用バインダオブジェクト(オプション)</param>
  * <param name='loadAwbOnMemory'>AWBファイルをメモリ上にロードするか(オプション)</param>
  * <returns>キューシートオブジェクト</returns>
  * <remarks>
  * <para header='説明'>引数に指定したデータとファイルパス情報からキューシートの追加を行います。<br/>
  * 同時に複数のキューシートを登録することが可能です。<br/>
  * <br/>
  * ファイルパスに対して相対パスを指定した場合は StreamingAssets フォルダからの相対でファイルをロードします。<br/>
  * 絶対パス、あるいはURLを指定した場合には指定したパスでファイルをロードします。<br/>
  * <br/>
  * CPKファイルにパッキングされたAWBファイルからキューシートを追加する場合は、
  * awbBinder引数にCPKをバインドしたバインダを指定してください。<br/>
  * なお、バインダ機能はADX2LEではご利用になれません。<br/>
  * <br/>
  * 戻り値のキューシートオブジェクトの CriAtomCueSheet::isLoading メンバが true を返す間はロード中です。<br/>
  * 必ず false を返すのを確認してからキューの再生等を行うようにしてください。<br/>
  * <br/>
  * loadAwbOnMemory が false の場合、AWBファイルのヘッダ部分のみをメモリ上にロードしストリーム再生を行います。<br/>
  * loadAwbOnMemory を true に設定すると、AWBファイル全体をメモリ上にロードするため実質メモリ再生になります。<br/>
  * WebGL(Editor実行時)では内部都合上、 loadAwbOnMemory が強制的にtrueになります。<br/></para>
  * </remarks>
  */
 public static CriAtomCueSheet AddCueSheetAsync(string name, byte[] acbData, string awbFile, CriFsBinder awbBinder = null, bool loadAwbOnMemory = false)
 {
     #if UNITY_EDITOR && UNITY_WEBGL
     loadAwbOnMemory = true;
     #endif
     CriAtomCueSheet cueSheet = CriAtom.instance.AddCueSheetInternal(name, "", awbFile, awbBinder);
     if (Application.isPlaying)
     {
         CriAtom.instance.LoadAcbDataAsync(cueSheet, acbData, awbBinder, awbFile, loadAwbOnMemory);
     }
     return(cueSheet);
 }
Пример #13
0
 public CriAtomCueSheet GetCueSheetInternal(string name)
 {
     for (int i = 0; i < this.cueSheets.Length; i++)
     {
         CriAtomCueSheet cueSheet = this.cueSheets[i];
         if (cueSheet.name == name)
         {
             return(cueSheet);
         }
     }
     return(null);
 }
Пример #14
0
 /**
  * <summary>キューシートの追加(メモリからの読み込み)</summary>
  * <param name='name'>キューシート名</param>
  * <param name='acbData'>ACBデータ</param>
  * <param name='awbFile'>AWBファイルパス</param>
  * <param name='awbBinder'>AWB用バインダオブジェクト(オプション)</param>
  * <returns>キューシートオブジェクト</returns>
  * <remarks>
  * <para header='説明'>引数に指定したデータとファイルパス情報からキューシートの追加を行います。<br/>
  * 同時に複数のキューシートを登録することが可能です。<br/>
  * <br/>
  * ファイルパスに対して相対パスを指定した場合は StreamingAssets フォルダからの相対でファイルをロードします。<br/>
  * 絶対パス、あるいはURLを指定した場合には指定したパスでファイルをロードします。<br/>
  * <br/>
  * CPKファイルにパッキングされたAWBファイルからキューシートを追加する場合は、
  * awbBinder引数にCPKをバインドしたバインダを指定してください。<br/>
  * なお、バインダ機能はADX2LEではご利用になれません。<br/></para>
  * </remarks>
  */
 public static CriAtomCueSheet AddCueSheet(string name, byte[] acbData, string awbFile, CriFsBinder awbBinder = null)
 {
     #if CRIWARE_FORCE_LOAD_ASYNC
     return(CriAtom.AddCueSheetAsync(name, acbData, awbFile, awbBinder));
     #else
     CriAtomCueSheet cueSheet = CriAtom.instance.AddCueSheetInternal(name, "", awbFile, awbBinder);
     if (Application.isPlaying)
     {
         cueSheet.acb = CriAtom.instance.LoadAcbData(acbData, awbBinder, awbFile);
     }
     return(cueSheet);
     #endif
 }
        public static bool AddCueSheet(CriAtomCueSheet cueSheet)
        {
            if (cueSheet == null || string.IsNullOrEmpty(cueSheet.name))
            {
                return(false);
            }

            CriAtom.AddCueSheet(
                cueSheet.name,
                cueSheet.acbFile,
                cueSheet.awbFile);
            return(true);
        }
Пример #16
0
    private void CreateAtomSourceGameObject(bool createGameObjectFlag)
    {
        if (Selection.gameObjects.Length == 0)
        {
            createGameObjectFlag = true;
        }
        var acbInfoList = projInfo.GetAcbInfoList(false, searchPath);

        if (acbInfoList.Count > this.selectedCueSheetId)
        {
            GameObject go = null;
            if (createGameObjectFlag)
            {
                go = new GameObject(acbInfoList[this.selectedCueSheetId].cueInfoList[this.selectedCueInfoIndex].name + "(CriAtomSource)");
                if (Selection.gameObjects.Length > 0)
                {
                    go.transform.parent = Selection.gameObjects[0].transform;
                }
                Undo.RegisterCreatedObjectUndo(go, "Create AtomSource GameObject");
            }
            else
            {
                go = Selection.gameObjects[0];
            }
            var     acbInfo = acbInfoList[this.selectedCueSheetId];
            CriAtom atom    = GameObject.FindObjectOfType(typeof(CriAtom)) as CriAtom;
            if (atom == null)
            {
                atom = CriWare.Common.managerObject.AddComponent <CriAtom>();
                var acfList = projInfo.GetAcfInfoList(false, searchPath);
                if (acfList.Count > selectedAcfId)
                {
                    atom.acfFile = acfList[selectedAcfId].filePath;
                }
            }
            CriAtomCueSheet cueSheet = atom.GetCueSheetInternal(acbInfo.name);
            if (cueSheet == null)
            {
                cueSheet = atom.AddCueSheetInternal(null, acbInfo.acbPath, acbInfo.awbPath, null);
            }
            CriAtomSource newCriAtomSource = go.AddComponent <CriAtomSource>();
            if (createGameObjectFlag == false)
            {
                Undo.RegisterCreatedObjectUndo(newCriAtomSource, "Add AtomSource Component");
            }
            newCriAtomSource.cueSheet = cueSheet.name;
            newCriAtomSource.cueName  = acbInfo.cueInfoList[this.selectedCueInfoIndex].name;
            Selection.activeObject    = go;
        }
    }
Пример #17
0
    /**
     * <summary>キューシートの追加(メモリからの読み込み)</summary>
     * <param name="name">キューシート名</param>
     * <param name="acbData">ACBデータ</param>
     * <param name="awbFile">AWBファイルパス</param>
     * <param name="awbBinder">AWB用バインダオブジェクト(オプション)</param>
     * <returns>キューシートオブジェクト</returns>
     * \par 説明:
     * 引数に指定したデータとファイルパス情報からキューシートの追加を行います。<br/>
     * 同時に複数のキューシートを登録することが可能です。<br/>
     * <br/>
     * ファイルパスに対して相対パスを指定した場合は StreamingAssets フォルダからの相対でファイルをロードします。<br/>
     * 絶対パス、あるいはURLを指定した場合には指定したパスでファイルをロードします。<br/>
     * <br/>
     * CPKファイルにパッキングされたAWBファイルからキューシートを追加する場合は、
     * awbBinder引数にCPKをバインドしたバインダを指定してください。<br/>
     * なお、バインダ機能はADX2LEではご利用になれません。<br/>
     */
    public static CriAtomCueSheet AddCueSheet(string name, byte[] acbData, string awbFile, CriFsBinder awbBinder = null)
    {
        CriAtomCueSheet cueSheet = CriAtom.instance.AddCueSheetInternal(name, "", awbFile, awbBinder);

        if (Application.isPlaying)
        {
                #if (!UNITY_EDITOR || UNITY_EDITOR_OSX) && UNITY_WEBGL
            CriAtom.instance.LoadAcbDataAsync(cueSheet, acbData, awbBinder, awbFile);
                #else
            cueSheet.acb = CriAtom.instance.LoadAcbData(acbData, awbBinder, awbFile);
                #endif
        }
        return(cueSheet);
    }
Пример #18
0
    private void CreateAtomSourceGameObject(bool createGameObjectFlag)
    {
        if (Selection.gameObjects.Length == 0)
        {
            createGameObjectFlag = true;
        }

        var acbInfoList = CriAtomAcfInfo.acfInfo.GetAcbInfoList(false, searchPath);

        if (acbInfoList.Length > this.selectedCueSheetId)
        {
            GameObject go = null;
            if (createGameObjectFlag)
            {
                go = new GameObject(acbInfoList[this.selectedCueSheetId].cueInfoList[this.selectedCueId].name + "(CriAtomSource)");
                if (Selection.gameObjects.Length > 0)
                {
                    go.transform.parent = Selection.gameObjects[0].transform;
                }
            }
            else
            {
                go = Selection.gameObjects[0];
            }

            var     acbInfo = acbInfoList[this.selectedCueSheetId];
            CriAtom atom    = GameObject.FindObjectOfType(typeof(CriAtom)) as CriAtom;
            if (atom == null)
            {
                atom         = CriWare.managerObject.AddComponent <CriAtom>();
                atom.acfFile = CriAtomAcfInfo.acfInfo.acfPath;
            }
            CriAtomCueSheet cueSheet = atom.GetCueSheetInternal(acbInfo.name);
            if (cueSheet == null)
            {
                cueSheet = atom.AddCueSheetInternal(null, acbInfo.acbPath, acbInfo.awbPath, null);
            }

            CriAtomSource newCriAtomSource = go.AddComponent <CriAtomSource>();
            newCriAtomSource.cueSheet = cueSheet.name;
            newCriAtomSource.cueName  = acbInfo.cueInfoList[this.selectedCueId].name;


            Selection.activeObject = go;

            //Debug.Log("Add \"CRI Atom Souce\" \"" + newCriAtomSource.AcbName + "/" + newCriAtomSource.CueName + "\"");
        }
    }
Пример #19
0
    private IEnumerator LoadAcbFileCoroutine(CriAtomCueSheet cueSheet, CriFsBinder binder, string acbPath, string awbPath, bool loadAwbOnMemory)
    {
        cueSheet.loaderStatus = CriAtomExAcbLoader.Status.Loading;

        if ((binder == null) && CriWare.Common.IsStreamingAssetsPath(acbPath))
        {
            acbPath = Path.Combine(CriWare.Common.streamingAssetsPath, acbPath);
        }

        if (!String.IsNullOrEmpty(awbPath))
        {
            if ((binder == null) && CriWare.Common.IsStreamingAssetsPath(awbPath))
            {
                awbPath = Path.Combine(CriWare.Common.streamingAssetsPath, awbPath);
            }
        }

        while (this.acfIsLoading)
        {
            yield return(null);
        }

        using (var asyncLoader = CriAtomExAcbLoader.LoadAcbFileAsync(binder, acbPath, awbPath, loadAwbOnMemory)) {
            if (asyncLoader == null)
            {
                cueSheet.loaderStatus = CriAtomExAcbLoader.Status.Error;
                yield break;
            }

            while (true)
            {
                var status = asyncLoader.GetStatus();
                cueSheet.loaderStatus = status;
                if (status == CriAtomExAcbLoader.Status.Complete)
                {
                    cueSheet.acb = asyncLoader.MoveAcb();
                    break;
                }
                else if (status == CriAtomExAcbLoader.Status.Error)
                {
                    break;
                }
                yield return(null);
            }
        }
    }
Пример #20
0
        private SoundSheet GetSoundSheet(CueInfo cueInfo)
        {
            if (cueInfo == null)
            {
                return(null);
            }

            var assetPath  = cueInfo.CueSheetPath;
            var soundSheet = managedSoundSheets.GetValueOrDefault(assetPath);

            if (soundSheet == null)
            {
                // パス情報生成.
                var acbPath = SoundSheet.AcbPath(assetPath);
                var awbPath = SoundSheet.AwbPath(assetPath);

                // ACBファイルのロード.
                CriAtomCueSheet cueSheet = null;

                try
                {
                    cueSheet = CriAtom.AddCueSheet(assetPath, acbPath, awbPath);
                }
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                    return(null);
                }

                if (cueSheet.acb == null)
                {
                    return(null);
                }

                // ロードしたACBを保持した状態で再生成.
                soundSheet = new SoundSheet(assetPath, cueSheet.acb);

                managedSoundSheets.Add(soundSheet.AssetPath, soundSheet);

                UnityConsole.Event(ConsoleEventName, ConsoleEventColor, "Load : {0}", acbPath);
            }

            return(soundSheet);
        }
        public void AddCueSheet(CriAtomCueSheet cueSheet)
        {
            if (!CriSoundUtility.AddCueSheet(cueSheet))
            {
                return;
            }

            var acb = CriAtom.GetAcb(cueSheet.name);

            if (acb == null)
            {
                Debug.unityLogger.LogError(GetType().Name, "NotFound cue sheet");
                return;
            }

            foreach (var cue in acb.GetCueInfoList())
            {
                cueSheetDictionary.Add(cue.name, cueSheet.name);
            }
        }
Пример #22
0
        public static IObservable <CriAtomCueSheet> AddCueSheet(CriAtomCueSheet cueSheet)
        {
            if (cueSheet == null)
            {
                throw new ArgumentException();
            }

            if (string.IsNullOrEmpty(cueSheet.name))
            {
                return(Observable.Return((CriAtomCueSheet)null));
            }

            return(Observable
                   .Return(CriAtom.AddCueSheet(cueSheet.name, cueSheet.acbFile, cueSheet.awbFile))
                   .SelectMany(x => Observable
                               .EveryUpdate()
                               .Where(_ => !x.IsLoading)
                               .Select(_ => x))
                   .First());
        }
Пример #23
0
 public void AddCueSheet(CriAtomCueSheet cueSheet)
 {
 }
Пример #24
0
	/*
	 * newDontRemoveExistsCueSheet == false の場合、古いキューシートを登録解除して、新しいキューシートの登録を行う。
	 * ただし同じキューシートの再登録は回避する
	 */
	private void MargeCueSheet(CriAtomCueSheet[] newCueSheets, bool newDontRemoveExistsCueSheet)
	{
		if (!newDontRemoveExistsCueSheet) {
			for (int i = 0; i < this.cueSheets.Length; ) {
				int index = Array.FindIndex(newCueSheets, sheet => sheet.name == this.cueSheets[i].name);
				if (index < 0) {
					CriAtom.RemoveCueSheet(this.cueSheets[i].name);
				} else {
					i++;
				}
			}
		}

		foreach (var sheet1 in newCueSheets) {
			var sheet2 = this.GetCueSheetInternal(sheet1.name);
			if (sheet2 == null) {
				this.AddCueSheetInternal(null, sheet1.acbFile, sheet1.awbFile, null);
			}
		}
	}
Пример #25
0
 private void LoadAcbDataAsync(CriAtomCueSheet cueSheet, byte[] acbData, CriFsBinder awbBinder, string awbFile, bool loadAwbOnMemory)
 {
     StartCoroutine(LoadAcbDataCoroutine(cueSheet, acbData, awbBinder, awbFile, loadAwbOnMemory));
 }
Пример #26
0
 public static CriAtomExPlayback Play(CriAtomCueSheet cueSheet, string cueName)
 {
     CriAtom.instance.player.SetCue(cueSheet.acb, cueName);
     return CriAtom.instance.player.Start();
 }
Пример #27
0
 public static CriAtomExPlayback Play(CriAtomCueSheet cueSheet, int cueId)
 {
     CriAtom.instance.player.SetCue(cueSheet.acb, cueId);
     return CriAtom.instance.player.Start();
 }
Пример #28
0
    private void MargeCueSheet(CriAtomCueSheet[] newCueSheets)
    {
        for (int i = 0; i < this.cueSheets.Length; ) {
            int j = 0;
            for (j = 0; j < newCueSheets.Length; j++) {
                if (newCueSheets[j].name == this.cueSheets[i].name) {
                    break;
                }
            }
            if (j == newCueSheets.Length) {
                CriAtom.RemoveCueSheet(this.cueSheets[i].name);
            } else {
                i++;
            }
        }

        foreach (var sheet1 in newCueSheets) {
            var sheet2 = this.GetCueSheetInternal(sheet1.name);
            if (sheet2 == null) {
                this.AddCueSheetInternal(null, sheet1.acbFile, sheet1.awbFile, null);
            }
        }
    }
Пример #29
0
    public void RemoveCueSheetInternal(string name)
    {
        int index = -1;
        for (int i = 0; i < this.cueSheets.Length; i++) {
            if (name == this.cueSheets[i].name) {
                index = i;
            }
        }
        if (index < 0) {
            return;
        }

        var cueSheet = this.cueSheets[index];
        if (cueSheet.acb != null) {
            cueSheet.acb.Dispose();
        }

        var cueSheets = new CriAtomCueSheet[this.cueSheets.Length - 1];
        Array.Copy(this.cueSheets, 0, cueSheets, 0, index);
        Array.Copy(this.cueSheets, index + 1, cueSheets, index, this.cueSheets.Length - index - 1);
        this.cueSheets = cueSheets;
    }
Пример #30
0
    public CriAtomCueSheet AddCueSheetInternal(string name, string acbFile, string awbFile, CriFsBinder binder)
    {
        var cueSheets = new CriAtomCueSheet[this.cueSheets.Length + 1];
        this.cueSheets.CopyTo(cueSheets, 0);
        this.cueSheets = cueSheets;

        var cueSheet = new CriAtomCueSheet();
        this.cueSheets[this.cueSheets.Length - 1] = cueSheet;
        if (String.IsNullOrEmpty(name)) {
            cueSheet.name = Path.GetFileNameWithoutExtension(acbFile);
        } else {
            cueSheet.name = name;
        }
        cueSheet.acbFile = acbFile;
        cueSheet.awbFile = awbFile;
        if (Application.isPlaying) {
            cueSheet.acb = this.LoadAcbFile(acbFile, awbFile);
        }
        return cueSheet;
    }