/** [シングルトン]constructor */ private SoundPool() { //main_file this.main_file = new Main_File(); //work_list this.work_list = new System.Collections.Generic.List <WorkItem>(); //add_list this.add_list = new System.Collections.Generic.List <WorkItem>(); }
/** [シングルトン]constructor */ private SoundPool() { //work this.work_pool = new List.NodePool <WorkItem>(16); this.work_add = new System.Collections.Generic.LinkedList <WorkItem>(); this.work_list = new System.Collections.Generic.LinkedList <WorkItem>(); //main_file this.main_file = new Main_File(); //player this.player = new Player(); //PlayerLoopType this.playerloop_flag = true; Fee.PlayerLoopSystem.PlayerLoopSystem.GetInstance().Add(Config.PLAYERLOOP_ADDTYPE, Config.PLAYERLOOP_TARGETTYPE, typeof(PlayerLoopType.Fee_SoundPool_Main), this.Main); }
/** 更新。 * * return == true : 完了。 * */ public bool Main() { switch (this.mode) { case Mode.Start: { switch (this.request_type) { case RequestType.LoadLocalPack: { if (Fee.SoundPool.SoundPool.GetInstance().GetMainFile().RequestLoadLocalPack(this.request_path) == true) { this.mode = Mode.Do_File; } } break; case RequestType.LoadStreamingAssetsPack: { if (Fee.SoundPool.SoundPool.GetInstance().GetMainFile().RequestLoadStreamingAssetsPack(this.request_path, this.request_data_version) == true) { this.mode = Mode.Do_File; } } break; case RequestType.LoadUrlPack: { if (Fee.SoundPool.SoundPool.GetInstance().GetMainFile().RequestLoadUrlPack(this.request_path, this.request_post_data, this.request_certificate_handler, this.request_data_version) == true) { this.mode = Mode.Do_File; } } break; } } break; case Mode.End: { } return(true); case Mode.Do_File: { Main_File t_main = Fee.SoundPool.SoundPool.GetInstance().GetMainFile(); this.item.SetResultProgress(t_main.GetResultProgress()); if (t_main.GetResultType() != Main_File.ResultType.None) { //結果。 bool t_success = false; switch (t_main.GetResultType()) { case Main_File.ResultType.Pack: { if (t_main.GetResultPack() != null) { this.item.SetResultResponseHeader(t_main.GetResultResponseHeader()); this.item.SetResultPack(t_main.GetResultPack()); t_success = true; } } break; } if (t_success == false) { this.item.SetResultErrorString(t_main.GetResultErrorString()); this.item.SetResultResponseHeader(t_main.GetResultResponseHeader()); } //完了。 t_main.Fix(); this.mode = Mode.End; } else if (this.item.IsCancel() == true) { //キャンセル。 t_main.Cancel(); } } break; } return(false); }