Advertisement
cm3d2-01

CM3D2.AddModsSlider.Plugin.0.0.2.3

Aug 23rd, 2015
446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 24.98 KB | None | 0 0
  1. // CM3D2.AddModsSlider.Plugin.0.0.2.3 : フリーコメント欄の各modパラメータをスライドバーで操作する UnityInjector 用プラグイン
  2.  
  3. // メイドエディット画面中にF5で表示トグル。
  4. // コメント欄で操作する数値をスライドバーで調整する事が可能。
  5. // \CM3D2\UnityInjector\Config\ModsParam.xml (サンプル: http://pastebin.com/wiCL6ETM )で各modパラメータを定義。このファイル必須。
  6. // フリーコメント欄にそのmodの有効な書式が在れば、該当するスライドバーが表示される。
  7.  
  8. // 更新履歴
  9. // 0.0.2.3 フォントサイズがウィンドウ幅と比例する様に。
  10. //     スクロールバーが滑らかに。
  11. //         ModsParam.xmlの<mod>属性 forced="..." が正常に機能していなかったのを修正。
  12. //         リフレクションがフレーム毎に実行されてたのを修正。(軽量化)
  13. // 0.0.2.2 ModsParam.xmlの書式を変更。
  14. //     ModsParam.xmlで<mod>の属性に forced="true" 指定で、フリーコメント欄にかかわらずそのmodのスライダーが表示される様に。
  15. //         <value>の属性でtype="scale"指定の時、最小値をスライダーに反映してなかったのを修正。
  16. // 0.0.1.1 各mod定義をxmlファイルにして読み込む様に。
  17. //         スライダーバーとフリーコメント欄が連動する様に。(改造スレその2>>192)
  18. //         EYEBALL,TEST_EYE_ANGの縦横が逆だったのを修正。
  19. // 0.0.0.0 初版
  20.  
  21. using System;
  22. using System.Collections.Generic;
  23. using System.IO;
  24. using System.Reflection;
  25. using System.Text;
  26. using System.Text.RegularExpressions;
  27. using System.Xml;
  28. using UnityEngine;
  29. using UnityInjector.Attributes;
  30.  
  31. namespace CM3D2.AddModsSlider.Plugin
  32. {
  33.     [PluginFilter("CM3D2x64"),
  34.     PluginFilter("CM3D2x86"),
  35.     PluginFilter("CM3D2VRx64"),
  36.     PluginName("CM3D2 AddModsSlider"),
  37.     PluginVersion("0.0.2.3")]
  38.     public class AddModsSlider : UnityInjector.PluginBase
  39.     {
  40.         public const string Version = "0.0.2.3";
  41.  
  42.         private int sceneLevel;
  43.         private bool visible = false;
  44.         private bool success = true;
  45.         private ModsParam mp;
  46.         private UIInput uiInputFreeComment;
  47.         private Vector2 scrollViewVector = Vector2.zero;
  48.  
  49.         public class ModsParam
  50.         {
  51.             public string DefMatchPattern = @"([-+]?[0-9]*\.?[0-9]+)";
  52.             public string XmlFileName = Directory.GetCurrentDirectory() + @"\UnityInjector\Config\ModsParam.xml";
  53.  
  54.             public string[] sKey;
  55.             public Dictionary<string, float[]> fValue = new Dictionary<string, float[]>();
  56.             public Dictionary<string, float[]> fVmin = new Dictionary<string, float[]>();
  57.             public Dictionary<string, float[]> fVmax = new Dictionary<string, float[]>();
  58.             public Dictionary<string, string[]> sLabel = new Dictionary<string, string[]>();
  59.             public Dictionary<string, bool[]> bScale = new Dictionary<string, bool[]>();
  60.             public Dictionary<string, string[]> sMatchPattern = new Dictionary<string, string[]>();
  61.  
  62.             public Dictionary<string, string> sDescription = new Dictionary<string, string>();
  63.             public Dictionary<string, bool> bForced = new Dictionary<string, bool>();
  64.             public Dictionary<string, bool> bEnabled = new Dictionary<string, bool>();
  65.  
  66.             public int KeyCount { get{return this.sKey.Length; } }
  67.             public int ValCount(string key) { return this.fValue[key].Length; }
  68.  
  69.             //--------
  70.  
  71.             public ModsParam()
  72.             {
  73.                 this.Init();
  74.             }
  75.  
  76.             public bool Init()
  77.             {
  78.                 if(!loadModsParamXML(this))
  79.                 {
  80.                     Debug.LogError("AddModsSlider : loadModsParamXML() failed.");
  81.                     return false;
  82.                 }
  83.  
  84.                 return true;
  85.             }
  86.  
  87.             private bool loadModsParamXML(ModsParam mp)
  88.             {
  89.                 string fn = mp.XmlFileName;
  90.                 bool flag = true;
  91.                
  92.                 if (File.Exists(fn))
  93.                 {
  94.                     XmlDocument doc = new XmlDocument();
  95.                     doc.Load(fn);
  96.  
  97.                     XmlNode root = doc.DocumentElement;
  98.  
  99.                     string format = ((XmlElement)root).GetAttribute("format");
  100.                     if (format != "1.0")
  101.                     {
  102.                         flag = loadModsParamXML00(mp, doc);
  103.                     }
  104.                     else if (root.HasChildNodes)
  105.                     {
  106.                         XmlNodeList mod_nodes = ((XmlElement)root).GetElementsByTagName("mod");
  107.  
  108.                         if (mod_nodes.Count > 0)
  109.                         {
  110.                             mp.sKey = new string[mod_nodes.Count];
  111.                         }
  112.                         else
  113.                         {
  114.                             flag = false;
  115.                         }
  116.  
  117.                         for (int i=0; i<mod_nodes.Count; i++)
  118.                         {
  119.                             if (!flag) break;
  120.                            
  121.                             // modノード
  122.                             XmlNode mod_node = mod_nodes[i];
  123.                             string key = ((XmlElement)mod_node).GetAttribute("id");
  124.  
  125.                             if (key != "" )
  126.                             {
  127.                                 mp.sKey[i] = key;
  128.                             }
  129.                             else
  130.                             {
  131.                                 flag = false;
  132.                                 break;
  133.                             }
  134.  
  135.                             // mod属性
  136.                             bool f,r;
  137.                             mp.sDescription[key] = ((XmlElement)mod_node).GetAttribute("description");
  138.  
  139.                             r = Boolean.TryParse(((XmlElement)mod_node).GetAttribute("forced"), out f);
  140.                             mp.bForced[key] = (r) ? f :false;
  141.                            
  142.                             r = Boolean.TryParse(((XmlElement)mod_node).GetAttribute("enabled"), out f);
  143.                             mp.bEnabled[key] = (r) ? f :false;
  144.  
  145.                             XmlNodeList values = ((XmlElement)mod_node).GetElementsByTagName("value");
  146.                             if (values.Count > 0)
  147.                             {
  148.                                 int tmp = values.Count;
  149.                                 mp.fValue[key] = new float[tmp];
  150.                                 mp.fVmin[key] = new float[tmp];
  151.                                 mp.fVmax[key] = new float[tmp];
  152.                                 mp.sLabel[key] = new string[tmp];
  153.                                 mp.bScale[key] = new bool[tmp];
  154.                                 mp.sMatchPattern[key] = new string[tmp];
  155.                             }
  156.                             else flag = false;    
  157.  
  158.                             // valueノード
  159.                             for (int j=0; j<values.Count; j++)
  160.                             {
  161.                                 if (!flag) break;
  162.  
  163.                                 mp.fValue[key][j] = 0f;
  164.                                 mp.fVmin[key][j] = 0f;
  165.                                 mp.fVmax[key][j] = 10f;
  166.                                 mp.sLabel[key][j] = "";
  167.                                 mp.bScale[key][j] = false;
  168.                                 mp.sMatchPattern[key][j] = "";
  169.  
  170.                                 XmlNode val_node = values[j];
  171.                                 int arg_no = -1;
  172.  
  173.                                 // value属性
  174.                                 r = Int32.TryParse(((XmlElement)val_node).GetAttribute("arg_no"), out arg_no);
  175.                                 arg_no = (r) ? arg_no-1 : -1;
  176.  
  177.                                 if (arg_no >= 0)
  178.                                 {
  179.                                     r = Single.TryParse(((XmlElement)val_node).GetAttribute("min"), out mp.fVmin[key][arg_no]);
  180.                                     if(!r) mp.fVmin[key][arg_no] = 0f;
  181.                                     r = Single.TryParse(((XmlElement)val_node).GetAttribute("max"), out mp.fVmax[key][arg_no]);
  182.                                     if(!r) mp.fVmax[key][arg_no] = 10f;
  183.  
  184.                                     mp.sLabel[key][arg_no] = ((XmlElement)val_node).GetAttribute("label");
  185.                                     mp.sMatchPattern[key][arg_no] = ((XmlElement)val_node).GetAttribute("match_pattern");
  186.  
  187.                                     string sv = ((XmlElement)mod_node).GetAttribute("type");
  188.                                     switch (sv)
  189.                                     {
  190.                                         case "num":      mp.bScale[key][arg_no] = false; break;
  191.                                         case "scale":    mp.bScale[key][arg_no] = true;  break;
  192.                                         default :        mp.bScale[key][arg_no] = false; break;
  193.                                     }
  194.                                 }
  195.                                 else  flag = false;
  196.                             }
  197.                         }
  198.                     }
  199.                 }
  200.                 else
  201.                 {
  202.                     Debug.LogError("AddModsSlider : \"" + fn + "\" does not exist.");
  203.                     flag = false;
  204.                 }
  205.                
  206.                 return flag;
  207.             }
  208.  
  209.             private bool loadModsParamXML00(ModsParam mp, XmlDocument doc)
  210.             {
  211.                 bool flag = true;
  212.                 {
  213.                     XmlNode root = doc.DocumentElement;
  214.                    
  215.                     if (root.HasChildNodes)
  216.                     {
  217.                         XmlNodeList mods = ((XmlElement)root).GetElementsByTagName("mod");
  218.  
  219.                         if (mods.Count > 0)
  220.                         {
  221.                             mp.sKey = new string[mods.Count];
  222.                         }
  223.                         else flag = false;
  224.  
  225.                         for (int i=0; i<mods.Count; i++)
  226.                         {
  227.                             if (!flag) break;
  228.                            
  229.                             XmlNode mod_node = mods[i];
  230.  
  231.                             string key = ((XmlElement)mod_node).GetAttribute("id");
  232.  
  233.                             if (key != "" ) mp.sKey[i] = key;
  234.                             else
  235.                             {
  236.                                 flag = false;
  237.                                 break;
  238.                             }
  239.  
  240.                             // mod子ノード
  241.                             XmlNodeList values = ((XmlElement)mod_node).GetElementsByTagName("value");
  242.                                
  243.                             if (values.Count > 0)
  244.                             {
  245.                                 int tmp = values.Count;
  246.                                 mp.fValue[key] = new float[tmp];
  247.                                 mp.fVmin[key] = new float[tmp];
  248.                                 mp.fVmax[key] = new float[tmp];
  249.                                 mp.sLabel[key] = new string[tmp];
  250.                                 mp.bScale[key] = new bool[tmp];
  251.                                 mp.sMatchPattern[key] = new string[tmp];
  252.                             }
  253.                             else flag = false;    
  254.  
  255.                             // valueノード
  256.                             for (int j=0; j<values.Count; j++)
  257.                             {
  258.                                 mp.fValue[key][j] = 0;
  259.                                 mp.fVmin[key][j] = -10;
  260.                                 mp.fVmax[key][j] = 10;
  261.                                 mp.sLabel[key][j] = "";
  262.                                 mp.bScale[key][j] = false;
  263.                                 mp.sMatchPattern[key][j] = "";
  264.  
  265.                                 if (!flag) break;
  266.  
  267.                                 XmlNode val_node = values[j];
  268.                                 int arg_no = -1;
  269.  
  270.                                 if(Int32.TryParse(((XmlElement)val_node).GetAttribute("arg_no"), out arg_no))
  271.                                 {
  272.                                     arg_no -= 1;
  273.                                 }
  274.                                 else
  275.                                 {
  276.                                     arg_no = -1;
  277.                                 }
  278.  
  279.                                 // value子ノード
  280.                                 if (arg_no >= 0)
  281.                                 {    
  282.                                     mp.bScale[key][arg_no] = (((XmlElement)val_node).GetAttribute("type") == "scale") ? true : false;
  283.                                     XmlNodeList value_params = val_node.ChildNodes;
  284.                                     foreach (XmlNode param in value_params)
  285.                                     {
  286.                                         switch (param.LocalName)
  287.                                         {
  288.                                             case "value_min":
  289.                                                 flag &= Single.TryParse(param.InnerText, out mp.fVmin[key][arg_no]);
  290.                                                 break;
  291.                                            
  292.                                             case "value_max":
  293.                                                 flag &= Single.TryParse(param.InnerText, out mp.fVmax[key][arg_no]);
  294.                                                 break;
  295.                                            
  296.                                             case "label": mp.sLabel[key][arg_no] = param.InnerText; break;
  297.                                             case "match_pattern": mp.sMatchPattern[key][arg_no] = param.InnerText; break;
  298.                                             default : break;
  299.                                         }
  300.                                        
  301.                                     }
  302.                                 }
  303.                                 else  flag = false;
  304.                             }
  305.  
  306.                             // その他mod子ノード
  307.                             XmlNodeList description = ((XmlElement)mod_node).GetElementsByTagName("description");
  308.                             mp.sDescription[key] = (description.Count > 0) ? description[0].InnerText : "";
  309.  
  310.                             XmlNodeList forced = ((XmlElement)mod_node).GetElementsByTagName("forced");
  311.                             mp.bForced[key] = (forced.Count > 0) ? true : false;
  312.  
  313.                             XmlNodeList enabled = ((XmlElement)mod_node).GetElementsByTagName("enabled");
  314.                             mp.bEnabled[key] = (enabled.Count > 0) ? true : false;
  315.                         }
  316.                     }
  317.                 }
  318.                 //Debug.LogError("flag = "+ flag);
  319.                 return flag;
  320.             }
  321.         }
  322.  
  323.     //--------
  324.  
  325.         public void Awake()
  326.         {
  327.              this.mp = new ModsParam();
  328.         }
  329.  
  330.         public void OnLevelWasLoaded(int level)
  331.         {
  332.             sceneLevel = level;
  333.             if (sceneLevel == 5) success = this.mp.Init();
  334.             else visible = false;
  335.         }
  336.  
  337.         public void Update()
  338.         {
  339.             if (success) {
  340.                 if (Input.GetKeyDown(KeyCode.F5)) visible = !visible;
  341.  
  342.                 if (sceneLevel == 5 && !this.uiInputFreeComment)
  343.                 {
  344.                     this.uiInputFreeComment = getUIInputFreeComment();
  345.                 }
  346.             }
  347.         }
  348.  
  349.         public void OnGUI()
  350.         {
  351.             if (!success || !visible || sceneLevel != 5) return;
  352.  
  353.             Maid maid =  GameMain.Instance.CharacterMgr.GetMaid(0);
  354.             string freeComment = null;
  355.  
  356.             if (maid == null) return;
  357.  
  358.             if (maid.Param != null && maid.Param.status != null && maid.Param.status.free_comment != null)
  359.             {
  360.                freeComment = maid.Param.status.free_comment;
  361.             }
  362.             if (freeComment == null) return;
  363.  
  364.             checkModsEnabled(this.mp, freeComment);
  365.             addModsSlider(this.mp);
  366.             updateFreeComment(maid, this.mp);
  367.          }
  368.  
  369.     //--------
  370.  
  371.         private void checkModsEnabled(ModsParam mp, string freeComment)
  372.         {
  373.             for(int i=0; i<mp.KeyCount; i++)
  374.             {
  375.                 string key = mp.sKey[i];
  376.                
  377.                 int val_num = mp.ValCount(key);
  378.                
  379.                 Match match = Regex.Match(freeComment, getMatchPattern(mp, key));
  380.                
  381.                 if (match.Groups.Count > val_num)
  382.                 {
  383.                     bool tpf = true;
  384.  
  385.                     for(int j=0; j<val_num; j++)
  386.                     {
  387.                         mp.bEnabled[key] = true;
  388.                         tpf &= Single.TryParse(match.Groups[j + 1].Value, out mp.fValue[key][j]);
  389.                     }
  390.                     if(!tpf) mp.bEnabled[key] = false;
  391.                 }
  392.                 else mp.bEnabled[key] = false;
  393.  
  394.                 if (mp.bForced[key]) mp.bEnabled[key] = true;
  395.             }
  396.         }
  397.  
  398.         private void addModsSlider(ModsParam mp)
  399.          {
  400.             int mod_num = mp.KeyCount;
  401.  
  402.             int margin =         fixPx(10);
  403.             int menuHeight =     fixPx(45);
  404.             int okButtonHeight = fixPx(90);
  405.             int lineC =          fixPx(14);
  406.             int lineH =          fixPx(22);
  407.             int lineH2 =         fixPx(24);
  408.             int lineH3 =         fixPx(30);
  409.             int fontC =          fixPx(11);
  410.             int fontH =          fixPx(14);
  411.             int fontH2 =         fixPx(16);
  412.             int fontH3 =         fixPx(20);
  413.  
  414.             int winTop = margin + menuHeight;
  415.             int winLeft = margin + (int)((Screen.width - margin * 2) * 0.75);
  416.             int winWidth = (int)((Screen.width - margin * 2) * 0.25);
  417.             int winHeight = (int)(Screen.height- winTop - margin - okButtonHeight);
  418.  
  419.             int conTop = lineH3 + margin * 1;
  420.             int conLeft = margin;
  421.             int conWidth = winWidth - margin * 4 ;
  422.             int conHeight = 0;
  423.            
  424.  
  425.             for (int i=0; i<mod_num; i++)
  426.             {
  427.                 string key = mp.sKey[i];
  428.                 if (!mp.bEnabled[key]) continue;
  429.  
  430.                 int val_num = mp.ValCount(key);
  431.  
  432.                 conHeight += lineH2;
  433.                 for (int j=0; j<val_num; j++) conHeight += lineH * 2;
  434.                 conHeight += margin * 2;
  435.             }
  436.  
  437.             Rect outRect = new Rect(winLeft, winTop, winWidth, winHeight);
  438.             GUI.BeginGroup(outRect);
  439.            
  440.             // 下地のボックス
  441.             GUIStyle bStyle = "box";
  442.             outRect.Set(0, 0, winWidth, winHeight);
  443.             bStyle.fontSize = fontC;
  444.             bStyle.alignment = TextAnchor.UpperRight;
  445.             GUI.Box(outRect, AddModsSlider.Version, bStyle);
  446.  
  447.             GUIStyle lStyle = "label";
  448.             lStyle.fontSize = fontH3;
  449.             outRect.Set(margin, margin, conWidth, lineH3);
  450.             GUI.Label(outRect, "Mods Slider", lStyle);
  451.            
  452.             // スクロールビュー
  453.             outRect.Set(0, conTop, winWidth-margin/2, winHeight-conTop-margin);
  454.             scrollViewVector = GUI.BeginScrollView(outRect, scrollViewVector, new Rect (0, 0, conWidth, conHeight));
  455.  
  456.             // 各modスライダーバー
  457.             outRect.Set(margin, 0, conWidth, lineH2);
  458.             for (int i=0; i<mod_num; i++)
  459.             {
  460.                 string key = mp.sKey[i];
  461.                 if (!mp.bEnabled[key]) continue;
  462.  
  463.                 int val_num = mp.ValCount(key);
  464.  
  465.                 for (int j=0; j<val_num; j++)
  466.                 {
  467.                     float value = mp.fValue[key][j];
  468.                     float vmin = mp.fVmin[key][j];
  469.                     float vmax = mp.fVmax[key][j];
  470.                     string label = mp.sLabel[key][j] +" : "+ value.ToString("F");
  471.                     bool isScale = mp.bScale[key][j];
  472.  
  473.                     if (j == 0)
  474.                     {
  475.                         lStyle.fontSize = fontH2;
  476.                         outRect.height = lineH2;
  477.                         GUI.Label(outRect, key, lStyle);
  478.                         outRect.y += outRect.height;
  479.                     }
  480.  
  481.                     outRect.height = lineH;
  482.                     if (value < vmin) value = vmin;
  483.                     if (value > vmax) value = vmax;
  484.                     if (isScale && vmin < 1f)
  485.                     {
  486.                         if (vmin < 0f) vmin = 0f;
  487.                         if (value < 0f) value = 0f;
  488.  
  489.                         float tmp = 0;
  490.                         float tmpmin = -Mathf.Abs(vmax - 1f);
  491.                         float tmpmax = Mathf.Abs(vmax - 1f);
  492.  
  493.                         if (value < 1f)
  494.                         {
  495.                             tmp = Mathf.Abs((1f-value)/(1f-vmin)) * tmpmin;
  496.                         }
  497.                         else tmp = value - 1f;
  498.  
  499.                         if(tmp < tmpmin) tmp = tmpmin;
  500.                         if(tmp > tmpmax) tmp = tmpmax;
  501.  
  502.                         tmp = drawModValueSlider(outRect, tmp, tmpmin, tmpmax, label, fontH);
  503.  
  504.                         if (tmp < 0f)
  505.                         {
  506.                             mp.fValue[key][j] = 1f - tmp/tmpmin * Mathf.Abs(1f-vmin);
  507.                         }
  508.                         else mp.fValue[key][j] = 1f + tmp;
  509.                     }
  510.                     else mp.fValue[key][j] = drawModValueSlider(outRect, value, vmin, vmax, label, fontH);
  511.                     outRect.y += outRect.height * 2;
  512.                 }
  513.  
  514.                 outRect.y += margin*2;
  515.             }
  516.  
  517.             GUI.EndScrollView();
  518.             GUI.EndGroup();
  519.         }
  520.  
  521.         private void updateFreeComment(Maid maid, ModsParam mp)
  522.         {
  523.             string freeComment = maid.Param.status.free_comment;
  524.  
  525.             for(int i=0; i<mp.KeyCount; i++)
  526.             {
  527.                 string key = mp.sKey[i];
  528.                 int vnum = mp.ValCount(key);
  529.  
  530.                 if (mp.bEnabled[key])
  531.                 {
  532.                     freeComment = Regex.Replace(freeComment, getMatchPattern(mp, key), "");
  533.                     string ws = @"#" + key;
  534.  
  535.                     for(int j=0; j<vnum; j++)
  536.                     {
  537.                         ws +=  (j == 0) ? "=" : ",";
  538.                         ws += mp.fValue[key][j].ToString("F2");
  539.                     }
  540.  
  541.                     ws += "#";
  542.                    
  543.                     freeComment += ws;
  544.                 }
  545.             }
  546.  
  547.             if(this.uiInputFreeComment) this.uiInputFreeComment.value = freeComment;
  548.             else maid.Param.SetFreeComment(freeComment);
  549.         }
  550.        
  551.  
  552.     //--------
  553.  
  554.         private int fixPx(int px)
  555.         {
  556.             float mag = 1f + (Screen.width/1280f - 1f) * 0.5f;
  557.  
  558.             return (int)(mag * px);
  559.         }
  560.  
  561.         private float drawModValueSlider(Rect outRect, float value, float min, float max, string label, int fsize)
  562.         {
  563.             GUIStyle lStyle = "label";
  564.             lStyle.fontSize = fsize;
  565.             GUI.Label(outRect, label, lStyle);
  566.  
  567.             outRect.y += outRect.height;
  568.              value = GUI.HorizontalSlider(outRect, value, min, max);
  569.             return value;
  570.         }
  571.  
  572.         private string getMatchPattern(ModsParam mp, string key)
  573.         {
  574.             string s = "#" + key;
  575.             int val_num = mp.ValCount(key);
  576.            
  577.             for(int j=0; j<val_num; j++)
  578.             {
  579.                 s += (j==0) ? "=" : ",";
  580.                
  581.                 if(mp.sMatchPattern[key][j] == "")
  582.                 {
  583.                     s += mp.DefMatchPattern;
  584.                 }
  585.                 else
  586.                 {
  587.                     s += mp.sMatchPattern[key][j];
  588.                 }                
  589.             }
  590.             s += "#";
  591.            
  592.             return s;
  593.         }
  594.  
  595.         // 改造スレその2 >>192
  596.         private UIInput getUIInputFreeComment()
  597.         {
  598.             BindingFlags bf = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
  599.  
  600.             ProfileMgr profileMgr = BaseMgr<ProfileMgr>.Instance;
  601.             if (profileMgr == null) return null;
  602.  
  603.             FieldInfo field_m_profileCtrl = typeof(ProfileMgr).GetField("m_profileCtrl", bf);
  604.             if (field_m_profileCtrl == null) return null;
  605.  
  606.             ProfileCtrl profileCtrl = (ProfileCtrl)field_m_profileCtrl.GetValue(profileMgr);
  607.             if (profileCtrl == null) return null;
  608.  
  609.             FieldInfo field_m_inFreeComment = typeof(ProfileCtrl).GetField("m_inFreeComment", bf);
  610.             if (field_m_inFreeComment == null) return null;
  611.  
  612.             UIInput uiInputFreeComment = (UIInput)field_m_inFreeComment.GetValue(profileCtrl);
  613.             if (uiInputFreeComment == null) return null;
  614.  
  615.             return uiInputFreeComment;
  616.         }
  617.  
  618.     }
  619.  
  620. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement