示例#1
0
    internal void EquipmentChange(string name, int index, Transform trans)
    {
        Debug.Log("  name = " + name + "     index = " + index);
        switch (name)
        {
        case "Head":
            _configs[1] = "head_" + index;
            break;

        case "Chest":
            _configs[2] = "chest_" + index;
            break;

        case "Hand":
            _configs[3] = "hand_" + index;
            break;

        case "Feet":
            _configs[4] = "feet_" + index;
            break;

        case "Weapon":
            _configs[5] = "weapon_" + index;
            break;
        }

        CharacterMgr.ChangeSkin(_characterInst, _configs, true);

        Transform transText = trans.Find("Text");
        Text      text      = transText.GetComponent <Text>();

        text.text = "√";
    }
示例#2
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);
        }
示例#3
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));
                    }
                }
            }
        }
示例#4
0
        private Maid FindPrevNextMaid(bool next)
        {
            List <Maid>  list = new List <Maid>();
            CharacterMgr val  = GameMain.Instance.CharacterMgr;

            for (int i = 0; i < val.GetMaidCount(); i++)
            {
                Maid val2 = val.GetMaid(i);
                if (val2 != null && val2.body0.isLoadedBody)
                {
                    list.Add(val2);
                }
            }
            if (list.Count == 0)
            {
                return(null);
            }
            if (focusChara != null)
            {
                int num = list.IndexOf(focusChara);
                if (num >= 0)
                {
                    num += (next ? 1 : (-1));
                    num  = (num + list.Count) % list.Count;
                    return(list[num]);
                }
            }
            return(list[0]);
        }
示例#5
0
        static void Main(string[] args)
        {
            Log.Info("CharacterCacher", "Lancement");

            Assembly.Load("Common");

            if (!EasyServer.InitLog("CharacterCacher", "Configs/CharacterCacher.log"))
            {
                return;
            }

            if (!EasyServer.InitConfig("Configs/CharacterCacher.xml", "CharacterCacher"))
            {
                return;
            }

            if (!EasyServer.InitMysqlDB("Configs/CharacterCacher.db", "Characters"))
            {
                return;
            }

            if (!EasyServer.InitRpcServer("CharacterCacher",
                                          EasyServer.GetConfValue <string>("CharacterCacher", "CharacterCacher", "Key"),
                                          EasyServer.GetConfValue <int>("CharacterCacher", "CharacterCacher", "Port")))
            {
                return;
            }

            CharMgr = new CharacterMgr();
            CharacterMgr.Database = EasyServer.GetDatabase("Characters");

            CharMgr.LoadRealms();

            EasyServer.StartConsole();
        }
示例#6
0
 private void Awake()
 {
     characterMgr     = FindObjectOfType <CharacterMgr>();
     statPrice        = 50;
     highValStatPrice = 3000;
     LoadPriceData();
 }
        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();
            }
        }
示例#8
0
    public FightProcess(FightAniMenager FightAniMgr)
    {
        this.CharacterMgr = new CharacterMgr();
        this.FightLogic   = new FightLogic();
        this.FightAniMgr  = FightAniMgr;

        StartFight();
    }
示例#9
0
 void CharacterMgrPresetSet(CharacterMgr cMgr, Maid maid, CharacterMgr.Preset preset)
 {
     if (maid == null)
     {
         return;
     }
     SliderTemplates.Update(maid, PluginName);
 }
示例#10
0
 private void Init()
 {
     LoadStageData();
     CheckLoadRound();
     // 고정된 캐릭터 - 추후 캐릭터 선택을 통해 변경되는 코드로 수정필요
     characterMgr  = characterMgr_obj.GetComponent <CharacterMgr>();
     enemyMgr      = esMgr_obj.GetComponent <EnemyMgr>();
     NextRoundDist = originNextRoundDist;
     text          = stage[curLevel.stage].textObj.GetComponent <TextMeshProUGUI>();
 }
示例#11
0
        public static void PresetSetHook(CharacterMgr mgr, Maid maid, CharacterMgr.Preset preset)
        {
            if (!ExtPresetSupport.Enabled)
            {
                return;
            }

            if (preset.strFileName == null ||
                !Path.GetExtension(preset.strFileName).Equals(".png", StringComparison.InvariantCulture))
            {
                return;
            }

            var presetFile = Path.Combine(PresetPath, preset.strFileName);

            if (!File.Exists(presetFile))
            {
                return;
            }

            using (var fs = File.OpenRead(presetFile))
            {
                var buf = new byte[EXT_DATA_BEGIN_MAGIC.Length];
                fs.Seek(-buf.Length, SeekOrigin.End);

                fs.Read(buf, 0, buf.Length);

                if (!BytesEqual(buf, EXT_DATA_END_MAGIC))
                {
                    Debug.Log($"[PNGPreset] No end magic found for {presetFile}");
                    return;
                }


                var pos = fs.Position - EXT_DATA_BEGIN_MAGIC.Length;

                while (true)
                {
                    if (pos < 0) // Just make sure so we don't f up in case the user tampered with the file
                    {
                        return;
                    }
                    fs.Position = pos;
                    fs.Read(buf, 0, buf.Length);

                    if (BytesEqual(buf, EXT_DATA_BEGIN_MAGIC))
                    {
                        break;
                    }
                    pos--;
                }

                ExtPresetSupport.LoadExPresetData(fs, maid);
            }
        }
 /// <summary>
 /// 프리셋 선택해서 메이드에게 입힐때 작동
 /// </summary>
 /// <param name="__instance"></param>
 /// <param name="f_maid"></param>
 /// <param name="f_prest"></param>
 //[HarmonyPatch(typeof(CharacterMgr), "PresetSet")]
 //[HarmonyPrefix]
 public static void PresetSet(CharacterMgr __instance, Maid f_maid, CharacterMgr.Preset f_prest)
 {
     MyLog.LogMessage("PresetSetPretfix1.f_prest.strFileName:"
                      + f_prest.strFileName
                      );
     //MaidProp[] array = PresetUtill.getMaidProp(f_prest);
     //foreach (MaidProp maidProp in array)
     //{
     //    MyLog.LogMessageS("PresetSetPretfix1: " + maidProp.idx + " , " + maidProp.strFileName);
     //}
 }
示例#13
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());
        }
示例#14
0
        static void Main(string[] args)
        {
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);
            Log.Texte("", "          _____   _____ ", ConsoleColor.Cyan);
            Log.Texte("", "    /\\   |  __ \\ / ____|", ConsoleColor.Cyan);
            Log.Texte("", "   /  \\  | |__) | (___  ", ConsoleColor.Cyan);
            Log.Texte("", "  / /\\ \\ |  ___/ \\___ \\ ", ConsoleColor.Cyan);
            Log.Texte("", " / ____ \\| |     ____) |", ConsoleColor.Cyan);
            Log.Texte("", "/_/    \\_\\_|    |_____/ APB-World", ConsoleColor.Cyan);
            Log.Texte("", "http://AllPrivateServer.com", ConsoleColor.DarkCyan);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);

            Assembly.Load("Common");

            Log.Info("WorldServer", "Starting ...");

            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <WorldServerConfig>();

            if (!Log.InitLog(Config.LogLevel, "WorldServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            FileServerClient = new RpcClient("WorldServer-File-" + Config.WorldID, Config.FileServerRpc.RpcLocalIp, 0);
            if (!FileServerClient.Start(Config.FileServerRpc.RpcServerIp, Config.FileServerRpc.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            CharacterServerClient = new RpcClient("WorldServer-Char-" + Config.WorldID, Config.CharacterServerRpc.RpcLocalIp, 0);
            if (!CharacterServerClient.Start(Config.CharacterServerRpc.RpcServerIp, Config.CharacterServerRpc.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            if (!TCPManager.Listen <TcpServer>(Config.WorldServerPort, "World"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            CharMgr = CharacterServerClient.GetServerObject <CharacterMgr>();
            FileMgr = FileServerClient.GetServerObject <FileManager>();

            CharMgr.RegisterWorld(CharacterServerClient.Info.RpcID,
                                  Config.WorldID,
                                  Config.WorldName,
                                  Config.WorldServerPort,
                                  Config.WorldServerIp);


            ConsoleMgr.Start();
        }
        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);
        }
示例#16
0
        public static bool PresetSaveHook(CharacterMgr mgr, out CharacterMgr.Preset preset, Maid maid,
                                          CharacterMgr.PresetType presetType)
        {
            if (!Input.GetKey(KeyCode.LeftControl) && !Input.GetKey(KeyCode.LeftControl))
            {
                preset = null;
                return(false);
            }

            preset = new CharacterMgr.Preset
            {
                ePreType = presetType,
                texThum  = ThumShot.ShotThumPreset(maid)
            };

            var bigThumTex = ThumUtil.MakeMaidThumbnail(maid);

            if (!Directory.Exists(PresetPath))
            {
                Directory.CreateDirectory(PresetPath);
            }

            using (var bw = new BinaryWriter(File.Create(Path.Combine(PresetPath,
                                                                      $"pre_{maid.status.lastName}{maid.status.firstName}_{DateTime.Now:yyyyMMddHHmmss}.png"))))
            {
                // Load our layers and combine them
                // Janky AF, but it works, so /shrug
                Texture2D composedImagePreset;
                var       backgroundLayer = LoadPNG(Path.Combine(LayerPath, "background.png"));
                composedImagePreset = CombineTextures(backgroundLayer, bigThumTex);
                var foregroundLayer = LoadPNG(Path.Combine(LayerPath, "foreground.png"));
                composedImagePreset = CombineTextures(composedImagePreset, foregroundLayer);

                bw.Write(composedImagePreset.EncodeToPNG());
                bw.Write(mgr.PresetSaveNotWriteFile(maid, presetType));

                var exData = ExtPresetSupport.SaveExPresetData(maid);

                if (exData != null)
                {
                    bw.Write(EXT_DATA_BEGIN_MAGIC);
                    bw.Write(exData);
                    bw.Write(EXT_DATA_END_MAGIC);
                }
            }

            GameMain.Instance.SysDlg.Show(
                "Saved image as a preset card\n(If you want to save a normal preset, don't hold [CTRL] while saving)",
                SystemDialog.TYPE.OK);

            return(true);
        }
示例#17
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());
        }
示例#18
0
        private Maid FindFirstMaid()
        {
            CharacterMgr val = GameMain.Instance.CharacterMgr;

            for (int i = 0; i < val.GetMaidCount(); i++)
            {
                Maid val2 = val.GetMaid(i);
                if (val2 != null && val2.body0.isLoadedBody)
                {
                    return(val2);
                }
            }
            return(null);
        }
示例#19
0
        public static bool PresetLoadHook(CharacterMgr mgr, out CharacterMgr.Preset result, BinaryReader br,
                                          string fileName)
        {
            result = null;

            if (fileName == null ||
                !Path.GetExtension(fileName).Equals(".png", StringComparison.InvariantCultureIgnoreCase))
            {
                return(false);
            }

            var stream = br.BaseStream;

            var buf = new byte[IEND_MAGIC.Length];

            var pos = 0;

            for (;; stream.Position = ++pos)
            {
                var len = stream.Read(buf, 0, buf.Length);

                if (len != IEND_MAGIC.Length)
                {
                    return(true);
                }

                if (BytesEqual(buf, IEND_MAGIC))
                {
                    break;
                }
            }

            // Skip CRC
            stream.Position += 4;

            var prevPos = stream.Position;

            if (br.ReadString() != "CM3D2_PRESET")
            {
                return(true);
            }

            stream.Position = prevPos;

            result             = mgr.PresetLoad(br, null);
            result.strFileName = fileName;

            return(true);
        }
    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);
        }
    }
    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);
        }
    }
 private void Start()
 {
     characterMgr = characterMgrObj.GetComponent <CharacterMgr>();
     goods        = goodsObj.GetComponent <Goods>();
     for (int winIdx = 0; winIdx < transform.childCount; winIdx++)
     {
         var tmp    = new Dictionary <string, Transform>();
         var curWin = transform.GetChild(winIdx);
         for (int i = 0; i < curWin.childCount; i++)
         {
             tmp.Add(curWin.GetChild(i).name, curWin.GetChild(i));
         }
         childs.Add(curWin.name, tmp);
     }
     Setting();
 }
示例#23
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);
             }
         }
     }
 }
        static bool PatchPresetDirectoryGetter(CharacterMgr __instance, ref string __result)
        {
            this4 = __instance;

            if (OriginalPresetDirectory == null)
            {
                OriginalPresetDirectory = Path.Combine(GameMain.Instance.SerializeStorageManager.StoreDirectoryPath, "Preset");
            }

            if (CustomPresetDirectory == null || CustomPresetDirectory == "")
            {
                return(true);
            }

            __result = CustomPresetDirectory;
            return(false);
        }
示例#25
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);
            }
        }
示例#26
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);
     }
 }
示例#29
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);
    }
示例#30
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);
    }