コード例 #1
0
 private IEnumerator DoCacheVoice(Action on_complete)
 {
     if (message != null && message.has_voice && model != null)
     {
         NPCLoader loader = model.GetComponent <NPCLoader>();
         if (loader != null)
         {
             LoadingQueue load_queue = new LoadingQueue(loader);
             load_queue.CacheVoice(message.voice_id, null);
             yield return((object)load_queue.Wait());
         }
     }
     on_complete();
 }
コード例 #2
0
    private IEnumerator LoadScriptResources()
    {
        Transform camera_t = MonoBehaviourSingleton <AppMain> .I.mainCameraTransform;

        initCameraPos = camera_t.get_position();
        cameraPosAnim.Set(initCameraPos);
        LoadingQueue load_queue = new LoadingQueue(this);

        for (int cmd_row = 0; cmd_row < scriptCommands.Count; cmd_row++)
        {
            string cmd = scriptCommands[cmd_row].cmd;
            string p4  = scriptCommands[cmd_row].p0;
            string p3  = scriptCommands[cmd_row].p1;
            string p2  = scriptCommands[cmd_row].p2;
            switch (cmd)
            {
            case "EFF_SHOW":
            {
                LoadObject load_obj = load_queue.LoadEffect(RESOURCE_CATEGORY.EFFECT_ACTION, p4, false);
                effectPrefabs.Add(p4, load_obj);
                if (effectRenderTex == null)
                {
                    effectRenderTex = UIRenderTexture.Get(effectTex, -1f, true, 1);
                    effectRenderTex.Enable(0.25f);
                }
                break;
            }

            case "SE_PLAY":
                try
                {
                    int se_id = int.Parse(p4);
                    load_queue.CacheSE(se_id, null);
                }
                catch
                {
                    Log.Error(LOG.EXCEPTION, "{0}コマンドのSEIDに整数ではない値が指定されています。", cmd);
                }
                break;

            case "MSG":
                if (!string.IsNullOrEmpty(p2))
                {
                    try
                    {
                        int voice_id = int.Parse(p2);
                        load_queue.CacheVoice(voice_id, null);
                    }
                    catch
                    {
                        Log.Error(LOG.EXCEPTION, "{0}コマンドのボイスIDに整数ではない値が指定されています。", cmd);
                    }
                }
                break;

            case "CHR_LOAD":
            {
                int id = -1;
                for (int i = 0; (float)i < 4f; i++)
                {
                    if (charas.Find((StoryCharacter o) => o.id == ((_003CLoadScriptResources_003Ec__IteratorC1) /*Error near IL_02d5: stateMachine*/)._003Ci_003E__11) == null)
                    {
                        id = i;
                        break;
                    }
                }
                if (id != -1)
                {
                    UITexture ui_tex = eventReceiver.GetModelUITexture(id);
                    if (ui_tex != null)
                    {
                        StoryCharacter chara = StoryCharacter.Initialize(id, ui_tex, p4, p3, p2);
                        if (chara != null)
                        {
                            charas.Add(chara);
                        }
                    }
                }
                break;
            }
            }
        }
        while (MonoBehaviourSingleton <ResourceManager> .I.isLoading || InstantiateManager.isBusy)
        {
            yield return((object)null);
        }
        isLoading = false;
    }
コード例 #3
0
    private IEnumerator DoInitialzie()
    {
        LoadingQueue loadQueue         = new LoadingQueue(this);
        LoadObject   loadedCutSceneObj = loadQueue.Load(RESOURCE_CATEGORY.CUTSCENE, "Opening", false);
        LoadObject   loadedTitleObj    = loadQueue.Load(RESOURCE_CATEGORY.CUTSCENE, "Title", false);

        int[] se_ids = (int[])Enum.GetValues(typeof(AUDIO));
        int[] array  = se_ids;
        foreach (int id in array)
        {
            loadQueue.CacheSE(id, null);
        }
        int[] voices = (int[])Enum.GetValues(typeof(VOICE));
        int[] array2 = voices;
        foreach (int id2 in array2)
        {
            loadQueue.CacheVoice(id2, null);
        }
        if (loadQueue.IsLoading())
        {
            yield return((object)loadQueue.Wait());
        }
        if (MonoBehaviourSingleton <AppMain> .I.mainCamera != null)
        {
            MonoBehaviourSingleton <AppMain> .I.mainCamera.set_enabled(false);
        }
        cutSceneObjectRoot = (ResourceUtility.Instantiate <Object>(loadedCutSceneObj.loadedObject) as GameObject);
        cutSceneObjectRoot.get_transform().set_parent(MonoBehaviourSingleton <AppMain> .I.get_transform());
        titleObjectRoot = (ResourceUtility.Instantiate <Object>(loadedTitleObj.loadedObject) as GameObject);
        titleObjectRoot.get_transform().set_parent(MonoBehaviourSingleton <AppMain> .I.get_transform());
        Transform eventObj = cutSceneObjectRoot.get_transform().FindChild("CUT_op");

        if (eventObj != null)
        {
            cutOP             = eventObj.get_gameObject();
            cutSceneAnimation = cutOP.GetComponent <Animation>();
            cutOP.SetActive(false);
        }
        Transform fade = cutSceneObjectRoot.get_transform().FindChild("Main Camera/Plane");

        if (fade != null)
        {
            MeshRenderer renderer = fade.GetComponent <MeshRenderer>();
            whiteFadeMaterial = renderer.get_material();
        }
        titleAnimation = titleObjectRoot.GetComponent <Animation>();
        cutSceneAnimation.Stop();
        MonoBehaviourSingleton <FieldManager> .I.SetCurrentFieldMapPortalID(10000100u);

        MonoBehaviourSingleton <GoWrapManager> .I.trackTutorialStep(TRACK_TUTORIAL_STEP_BIT.tutorial_start_screen, "Tutorial");

        MonoBehaviourSingleton <UIManager> .I.loading.HideAllPermissionMsg();

        base.Initialize();
        PredownloadManager.openingMode = true;
        MonoBehaviourSingleton <AppMain> .I.get_gameObject().AddComponent <PredownloadManager>();

        MonoBehaviourSingleton <UIManager> .I.loading.downloadGaugeVisible = false;
        PredownloadManager.Stop(PredownloadManager.STOP_FLAG.INGAME_TUTORIAL, true);
        DataTableManager dataTableManager = MonoBehaviourSingleton <DataTableManager> .I;

        Protocol.Send <CheckRegisterModel>(CheckRegisterModel.URL, delegate
        {
            ((_003CDoInitialzie_003Ec__IteratorEC) /*Error near IL_0399: stateMachine*/)._003CupdatedTableIndex_003E__15 = true;
        }, string.Empty);
        yield return((object)new WaitUntil((Func <bool>)(() => ((_003CDoInitialzie_003Ec__IteratorEC) /*Error near IL_03b0: stateMachine*/)._003CupdatedTableIndex_003E__15)));

        isDownloading = true;
        dataTableManager.InitializeForDownload();
        dataTableManager.UpdateManifest(delegate
        {
            ((_003CDoInitialzie_003Ec__IteratorEC) /*Error near IL_03ef: stateMachine*/)._003CdataTableManager_003E__14.LoadInitialTable(delegate
            {
                List <DataLoadRequest> loadings = ((_003CDoInitialzie_003Ec__IteratorEC) /*Error near IL_03ef: stateMachine*/)._003CdataTableManager_003E__14.LoadAllTable(delegate
                {
                    PredownloadManager.Stop(PredownloadManager.STOP_FLAG.INGAME_TUTORIAL, false);
                    ((_003CDoInitialzie_003Ec__IteratorEC) /*Error near IL_03ef: stateMachine*/)._003C_003Ef__this.isDownloading = false;
                }, true);
                MonoBehaviourSingleton <UIManager> .I.loading.SetProgress(new FirstOpeningProgress(loadings));
            }, true);
        });
        TitleTop.isFirstBoot = false;
    }