public void Update()
        {
            //PluginHelper.LineClear();
            PluginHelper.DebugClear();
            // テンプレートキャッシュを消去して、再読み込みを促す
            if (Input.GetKey(KeyCode.F12))
            {
                FaceScriptTemplates.Clear();
                SliderTemplates.Clear();
            }
            SliderTemplates.Update(PluginName);

            // エディット画面にいる場合は特別処理として毎フレームアップデートを行う
            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();
            }
        }
Ejemplo n.º 2
0
        public void Update()
        {
            //PluginHelper.LineClear();
            PluginHelper.DebugClear();
            // テンプレートキャッシュを消去して、再読み込みを促す
            if (Input.GetKey(KeyCode.F12))
            {
                FaceScriptTemplates.Clear();
                SliderTemplates.Clear();
            }
            SliderTemplates.Update(PluginName);

            // エディット画面にいる場合は特別処理として毎フレームアップデートを行う
            if (SceneManager.GetActiveScene().name == "SceneEdit")
            {
                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));
                    }
                }
            }
        }
Ejemplo n.º 3
0
        // Token: 0x06000006 RID: 6 RVA: 0x00002368 File Offset: 0x00000568
        public static List <Maid> GetVisibleMaidList()
        {
            List <Maid>  list         = new List <Maid>();
            CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
            int          maidCount    = characterMgr.GetMaidCount();

            for (int i = 0; i < maidCount; i++)
            {
                Maid maid = characterMgr.GetMaid(i);
                if (maid != null && maid.isActiveAndEnabled && maid.Visible)
                {
                    list.Add(maid);
                }
            }
            int stockMaidCount = characterMgr.GetStockMaidCount();

            for (int j = 0; j < stockMaidCount; j++)
            {
                Maid stockMaid = characterMgr.GetStockMaid(j);
                if (stockMaid != null && stockMaid.isActiveAndEnabled && stockMaid.Visible && !list.Contains(stockMaid))
                {
                    list.Add(stockMaid);
                }
            }
            return(list);
        }
        public static void CleanupMaids()
        {
            List <string> guids = new List <string>();
            CharacterMgr  cm    = GameMain.Instance.CharacterMgr;

            for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
            {
                Maid maid = cm.GetStockMaid(i);
                guids.Add(maid.Param.status.guid);
            }
            CleanupMaids(guids);
        }
Ejemplo n.º 5
0
        public static void RemoveEventEndFlagAll()
        {
            Action <Maid> action = delegate(Maid maid) {
                maid.status.RemoveEventEndFlagAll();
            };

            for (int j = 0; j < characterMgr.GetStockMaidCount(); j++)
            {
                Maid stockMaid = characterMgr.GetStockMaid(j);
                MyLog.LogMessage(".RemoveEventEndFlagAll:" + stockMaid.status.fullNameJpStyle);;
                action(stockMaid);
            }
        }
Ejemplo n.º 6
0
    public static void Update(string PluginName)
    {
        // エディット画面以外では何もせず終了
        if (UnityEngine.Application.loadedLevel != 5)
        {
            return;
        }
        CharacterMgr cm = GameMain.Instance.CharacterMgr;

        for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
        {
            Maid maid = cm.GetStockMaid(i);
            Update(maid, PluginName);
        }
    }
    public static void Update(string PluginName)
    {
        // エディット画面以外では何もせず終了
        if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name != "SceneEdit")
        {
            return;
        }
        CharacterMgr cm = GameMain.Instance.CharacterMgr;

        for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
        {
            Maid maid = cm.GetStockMaid(i);
            Update(maid, PluginName);
        }
    }
Ejemplo n.º 8
0
 /// <summary>
 /// AddModsSlider等から呼び出されるコールバック
 /// 呼び出し方法は this.gameObject.SendMessage("MaidVoicePitch.TestUpdateSliders");
 /// </summary>
 public void MaidVoicePitch_UpdateSliders()
 {
     if (GameMain.Instance != null && GameMain.Instance.CharacterMgr != null)
     {
         CharacterMgr cm = GameMain.Instance.CharacterMgr;
         for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
         {
             Maid maid = cm.GetStockMaid(i);
             if (maid != null)
             {
                 // 同じ "sintyou" の値を入れて、強制的にモーフ再計算を行う
                 float SCALE_Sintyou = maid.body0.bonemorph.SCALE_Sintyou;
                 maid.body0.BoneMorph_FromProcItem("sintyou", SCALE_Sintyou);
             }
         }
     }
 }
Ejemplo n.º 9
0
        // 動作していない古い設定を削除する
        static void CleanupExSave()
        {
            string[] obsoleteSettings =
            {
                "WIDESLIDER.enable",  "PROPSET_OFF.enable",     "LIPSYNC_OFF.enable",
                "HYOUJOU_OFF.enable", "EYETOCAMERA_OFF.enable", "MUHYOU.enable",
                "FARMFIX.enable",     "EYEBALL.enable",         "EYE_ANG.enable",
                "PELSCL.enable",      "SKTSCL.enable",          "THISCL.enable",     "THIPOS.enable",
                "PELVIS.enable",      "FARMFIX.enable",         "SPISCL.enable",
                "S0ASCL.enable",      "S1_SCL.enable",          "S1ASCL.enable",
                "FACE_OFF.enable",    "FACEBLEND_OFF.enable",

                // 以下0.2.4で廃止
                "FACE_ANIME_SPEED",
                "MABATAKI_SPEED",
                "PELVIS",             "PELVIS.x",               "PELVIS.y",          "PELVIS.z",
            };
            CharacterMgr cm = GameMain.Instance.CharacterMgr;

            for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
            {
                Maid maid = cm.GetStockMaid(i);
                foreach (string s in obsoleteSettings)
                {
                    ExSaveData.Remove(maid, PluginName, s);
                }

                {
                    string fname = ExSaveData.Get(maid, PluginName, "SLIDER_TEMPLATE", null);
                    if (string.IsNullOrEmpty(fname))
                    {
                        ExSaveData.Set(maid, PluginName, "SLIDER_TEMPLATE", "UnityInjector/Config/MaidVoicePitchSlider.xml", true);
                    }
                }
            }

            string[] obsoleteGlobalSettings =
            {
                "TEST_GLOBAL_KEY"
            };
            foreach (string s in obsoleteGlobalSettings)
            {
                ExSaveData.GlobalRemove(PluginName, s);
            }
        }
Ejemplo n.º 10
0
    public static void FreeCommentToSetting(string PluginName, bool overwrite)
    {
        CharacterMgr cm = GameMain.Instance.CharacterMgr;

        for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
        {
            Maid maid = cm.GetStockMaid(i);

            try
            {
                FreeCommentToSetting(maid, PluginName, overwrite);
            }
            catch (Exception e)
            {
                Helper.ShowException(e);
            }
        }
    }
 /// <summary>
 /// AddModsSlider等から呼び出されるコールバック
 /// 呼び出し方法は this.gameObject.SendMessage("MaidVoicePitch.TestUpdateSliders");
 /// </summary>
 public void MaidVoicePitch_UpdateSliders()
 {
     if (GameMain.Instance != null && GameMain.Instance.CharacterMgr != null)
     {
         CharacterMgr cm = GameMain.Instance.CharacterMgr;
         for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
         {
             Maid maid = cm.GetStockMaid(i);
             if (maid != null && maid.body0 != null && maid.body0.bonemorph != null)
             {
                 //
                 //	todo	本当にこの方法しかないのか調べること
                 //
                 //	1人目のメイドをエディットし、管理画面に戻り、
                 //	続けて2人目をエディットしようとすると、1人目のメイドの
                 //	boneMorphLocal.linkT が null になっていて例外がおきるので
                 //	あらかじめ linkT を調べる
                 //
                 bool safe = true;
                 foreach (BoneMorphLocal boneMorphLocal in maid.body0.bonemorph.bones)
                 {
                     if (boneMorphLocal.linkT == null)
                     {
                         safe = false;
                     }
                 }
                 if (safe)
                 {
                     try
                     {
                         // 同じ "sintyou" の値を入れて、強制的にモーフ再計算を行う
                         float SCALE_Sintyou = maid.body0.bonemorph.SCALE_Sintyou;
                         maid.body0.BoneMorph_FromProcItem("sintyou", SCALE_Sintyou);
                     }
                     catch (Exception)
                     {
                         ; // 最低だ…
                     }
                 }
             }
         }
     }
 }
 static void serializeCallback(GameMain that, int f_nSaveNo, string f_strComment)
 {
     try
     {
         CharacterMgr cm = GameMain.Instance.CharacterMgr;
         for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
         {
             Maid maid = cm.GetStockMaid(i);
             SetMaidName(maid);
         }
         CleanupMaids();
         string path        = GameMainMakeSavePathFileName(that, f_nSaveNo);
         string xmlFilePath = makeXmlFilename(that, f_nSaveNo);
         PluginSettings.Save(xmlFilePath, path);
     }
     catch (Exception e)
     {
         Helper.ShowException(e);
     }
 }
Ejemplo n.º 13
0
    // BoneMorph_を手がかりに、Maidを得る
    public static Maid GetMaid(BoneMorph_ boneMorph_)
    {
        if (boneMorph_ == null)
        {
            return(null);
        }
        CharacterMgr cm = GameMain.Instance.CharacterMgr;

        for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
        {
            Maid maid = cm.GetStockMaid(i);
            if (maid.body0 == null || maid.body0.bonemorph == null)
            {
                continue;
            }
            if (object.ReferenceEquals(maid.body0.bonemorph, boneMorph_))
            {
                return(maid);
            }
        }
        return(null);
    }
Ejemplo n.º 14
0
    // AudioSourceMgrを手がかりに、Maidを得る
    public static Maid GetMaid(AudioSourceMgr audioSourceMgr)
    {
        if (audioSourceMgr == null)
        {
            return(null);
        }
        CharacterMgr cm = GameMain.Instance.CharacterMgr;

        for (int i = 0, n = cm.GetStockMaidCount(); i < n; i++)
        {
            Maid maid = cm.GetStockMaid(i);
            if (maid.AudioMan == null)
            {
                continue;
            }
            if (object.ReferenceEquals(maid.AudioMan, audioSourceMgr))
            {
                return(maid);
            }
        }
        return(null);
    }