コード例 #1
0
 //展示选择平台
 private void ShowSelectPlatform()
 {
     EditorGUILayout.LabelField("Select Platform", GUIHelper.MakeHeader());
     EditorGUILayout.LabelField("Current Platform: " + currentPlatform.ToString(), GUIHelper.MakeHeader());
     GUILayout.BeginHorizontal();
     foreach (InjectPlatForm platform in System.Enum.GetValues(typeof(InjectPlatForm)))
     {
         if (GUILayout.Button(platform.ToString(), GUILayout.Width(150)))
         {
             currentPlatform = platform;
         }
     }
     GUILayout.EndHorizontal();
 }
コード例 #2
0
        //展示注入信息
        private void ShowInjectInfo(InjectPlatForm currentPlatform)
        {
            EditorGUILayout.LabelField("Platform Info", GUIHelper.MakeHeader());
            var       infoXmlTextAsset = EditorResources.GetAsset <TextAsset>("InjectDll", "CodeInject");
            XDocument xDoc             = XDocument.Parse(infoXmlTextAsset.text);
            var       infoRoot         = xDoc.Root.Element(currentPlatform.ToString());

            foreach (var infoElement in infoRoot.Elements())
            {
                string attrbutes = infoElement.Element("injectAttr").Value;
                if (!string.IsNullOrEmpty(attrbutes))
                {
                    var dllEles = new List <XElement>(infoElement.Elements("dll"));
                    foreach (var dllEle in dllEles)
                    {
                        EditorGUILayout.LabelField("Effect Dll:" + dllEle.Name.LocalName);
                    }
                    EditorGUILayout.LabelField("To Inject:" + attrbutes);
                }
            }
        }