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();
            }
        }
示例#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));
                    }
                }
            }
        }
示例#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);
        }
示例#4
0
        // Token: 0x06000281 RID: 641 RVA: 0x00015CEC File Offset: 0x00013EEC
        public void DetectMaidTarget(bool useStockMaid)
        {
            CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;

            if (useStockMaid)
            {
                this.DetectTarget(new Func <int, Maid>(characterMgr.GetStockMaid), characterMgr.GetStockMaidCount());
                return;
            }
            this.DetectTarget(new Func <int, Maid>(characterMgr.GetMaid), characterMgr.GetMaidCount());
        }
        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);
        }
示例#6
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);
            }
        }
示例#7
0
        // Token: 0x06000280 RID: 640 RVA: 0x00015C84 File Offset: 0x00013E84
        public void DetectAllTarget(bool useStockMaid = false)
        {
            CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;

            if (useStockMaid)
            {
                this.DetectTarget(new Func <int, Maid>(characterMgr.GetStockMaid), characterMgr.GetStockMaidCount());
            }
            else
            {
                this.DetectTarget(new Func <int, Maid>(characterMgr.GetMaid), characterMgr.GetMaidCount());
            }
            this.DetectTarget(new Func <int, Maid>(characterMgr.GetMan), characterMgr.GetManCount());
        }
    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);
        }
    }
示例#10
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);
             }
         }
     }
 }
示例#11
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);
            }
        }
示例#12
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);
     }
 }
示例#15
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);
    }
示例#16
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);
    }