コード例 #1
0
        public void OnLevelWasLoaded(int level)
        {
            KagHooks.SetHook(PluginName, true);

            // TBody.MoveHeadAndEye 処理終了後のコールバック
            CM3D2.MaidVoicePitch.Managed.Callbacks.TBody.MoveHeadAndEye.Callbacks[PluginName] = tbodyMoveHeadAndEyeCallback;

            // BoneMorph_.Blend 処理終了後のコールバック
            CM3D2.MaidVoicePitch.Managed.Callbacks.BoneMorph_.Blend.Callbacks[PluginName] = boneMorph_BlendCallback;

            // AudioSourceMgr.Play処理終了後のコールバック
            CM3D2.MaidVoicePitch.Managed.Callbacks.AudioSourceMgr.Play.Callbacks[PluginName] =
                (audioSourceMgr, f_fFadeTime, loop) =>
            {
                SetAudioPitch(audioSourceMgr);
            };

            // AudioSourceMgr.PlayOneShot処理終了後のコールバック
            CM3D2.MaidVoicePitch.Managed.Callbacks.AudioSourceMgr.PlayOneShot.Callbacks[PluginName] =
                (audioSourceMgr) =>
            {
                SetAudioPitch(audioSourceMgr);
            };

            // GameMain.Deserialize処理終了後のコールバック
            //  ロードが行われたときに呼び出される
            CM3D2.ExternalSaveData.Managed.GameMainCallbacks.Deserialize.Callbacks[PluginName] =
                (gameMain, f_nSaveNo) =>
            {
                bDeserialized = true;
            };

            // ロード直後のシーン読み込みなら、初回セットアップを行う
            if (bDeserialized)
            {
                bDeserialized = false;
                ExSaveData.CleanupMaids();
                FreeComment.FreeCommentToSetting(PluginName, false);
                CleanupExSave();
            }
        }
コード例 #2
0
        public void Update()
        {
            //PluginHelper.LineClear();
            PluginHelper.DebugClear();
            // テンプレートキャッシュを消去して、再読み込みを促す
            if (Input.GetKey(KeyCode.F12))
            {
                FaceScriptTemplates.Clear();
                SliderTemplates.Clear();
            }
            SliderTemplates.Update(PluginName);

            // フリーコメントから設定を読み込む
            if (Input.GetKey(KeyCode.F4))
            {
                FreeComment.FreeCommentToSetting(PluginName, true);
                CleanupExSave();
            }

            // エディット画面にいる場合は特別処理として毎フレームアップデートを行う
            if (Application.loadedLevel == 5)
            {
                if (GameMain.Instance != null && GameMain.Instance.CharacterMgr != null)
                {
                    CharacterMgr cm = GameMain.Instance.CharacterMgr;
                    for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
                    {
                        EditSceneMaidUpdate(cm.GetStockMaid(i));
                    }
                }

                // todo	以下を直すこと:
                //		FARMFIX等のスライダーではないトグル操作等を行った場合にコールバックが
                //		呼ばれていない。これを回避するため、とりあえず毎フレーム呼びだすことにする
                //
                MaidVoicePitch_UpdateSliders();
            }
        }