当前位置: 首页 > news >正文

无锡网站建设方案学校网站建设措施

无锡网站建设方案,学校网站建设措施,长春做企业网站多少钱,网站会员权限在PropertyDrawer中#xff0c;您不能使用来自GUILayout或EditorGUILayout的自动布局API#xff0c;而只能使用来自GUI和EditorGUI的绝对Rect API始终传递相应的起始位置和维度。 你需要 计算显示嵌套内容所需的总高度将此高度添加到public override float GetPropertyHeig… 在PropertyDrawer中您不能使用来自GUILayout或EditorGUILayout的自动布局API而只能使用来自GUI和EditorGUI的绝对Rect API始终传递相应的起始位置和维度。 你需要 计算显示嵌套内容所需的总高度将此高度添加到public override float GetPropertyHeight这将告诉检查员根据Rect保留以绘制您的财产将为sub-editor保留的相应Rect传递到editor中并在给定位置和尺寸处绘制 您不能简单地使用默认编辑器来实现这一点因为它在PropertyDrawers无法使用的auto-layout系统中运行。 #region UNITY_EDITOR using System.Collections.Generic; using System; using UnityEditor; using static UnityEditor.Progress; using UnityEngine; using Unity.VisualScripting; using System.Collections.ObjectModel; using System.ComponentModel; using System.Xml.Linq; using System.IO;public class UICollector : MonoBehaviour {public string GenerateClassName;public OperateSetting OperateSetting;public ListComponentInfo components new ListComponentInfo();public void GenerateMainClass(){// F:\AAAAAAAAAAAG4\UnityProject\MyDoor\trunk\client_root\Assets\Scripts\Game\Runtime\Logic\Dialog\_AirShipBodayTab.csstring mainPath ${Application.dataPath}/Scripts/Game/Runtime/Logic/Dialog/{GenerateClassName}.cs;if (!File.Exists(mainPath)){File.Create(mainPath).Close(); }UnityEditor.AssetDatabase.Refresh();File.WriteAllText(mainPath,using UnityEngine; using System; using UnityEngine.UI; public partial class _D_CLASSNAME : Dialog {public override bool IsFullScreen() { return true;}public override bool NeedShowCoins(){ return false; }protected override void OnCreate(){} } .Replace(_D_CLASSNAME, GenerateClassName));UnityEditor.AssetDatabase.Refresh();GeneratePartClass();}private void GeneratePartClass(){string fielddata ;string referdata ;foreach (var item in components){if (!string.IsNullOrEmpty(item.name) item.component!null){fielddata $private {item.component.GetType().Name} {item.name};\n;referdata ${item.name} transform.Find(\{ item.path }\).GetComponent{item.component.GetType().Name}();\n;}}string baseTemp using System; using UnityEngine; using UnityEngine.UI;public partial class _D_CLASSNAME : Dialog {FILEDLISTprotected override void InitRef(){REFERENCE} } ;string info ;info baseTemp.Replace(FILEDLIST, fielddata);info info.Replace(_D_CLASSNAME, GenerateClassName);info info.Replace(REFERENCE, referdata);string aprtPath ${Application.dataPath}/Scripts/Game/Runtime/Logic/Dialog/Partial/{GenerateClassName}.cs;if (!File.Exists(aprtPath)){File.CreateText(aprtPath).Close();UnityEditor.AssetDatabase.Refresh(); }File.WriteAllText(aprtPath, info);UnityEditor.AssetDatabase.Refresh();}}[Serializable] public class ComponentInfo {public string name;public string path;public int index;public UnityEngine.Component component;public GameObject go;public GameObject lastObject; } [CustomPropertyDrawer(typeof(ComponentInfo))] public class ComponentInfoEditor : PropertyDrawer {private UnityEngine.Object lastObject;public override float GetPropertyHeight(SerializedProperty property, GUIContent label){return base.GetPropertyHeight(property, label) 40;//这个总区域的高度}public override void OnGUI(Rect position, SerializedProperty property, GUIContent label){GUI.color Color.white;float span 220;float width 180;var f1Rect new Rect(position.x span * 1, position.y, width, 20);var f2Rect new Rect(position.x span * 0, position.y, width, 20);var f3Rect new Rect(position.x, position.y 20, width, 20);var f4Rect new Rect(position.x span * 1, position.y 20, width, 20);var f5Rect new Rect(position.x span * 2, position.y 20, width, 20);EditorGUIUtility.labelWidth 70;var go property.FindPropertyRelative(go).objectReferenceValue;if (go ! null){EditorGUI.PropertyField(f2Rect, property.FindPropertyRelative(go));bool isChange false;var lastObject property.FindPropertyRelative(lastObject).objectReferenceValue;if (isChange false) isChange lastObject ! go;property.FindPropertyRelative(lastObject).objectReferenceValue go;UnityEngine.Component[] components go.GetComponentsUnityEngine.Component();Liststring types new Liststring();foreach (UnityEngine.Component comp in components){types.Add(comp.GetType().Name);}int nowindex EditorGUI.Popup(f1Rect, property.FindPropertyRelative(index).intValue, types.ToArray());if (isChange false) isChange property.FindPropertyRelative(index).intValue ! nowindex;property.FindPropertyRelative(index).intValue nowindex;int index property.FindPropertyRelative(index).intValue;property.FindPropertyRelative(component).objectReferenceValue components[index];if (isChange || string.IsNullOrEmpty(property.FindPropertyRelative(name).stringValue)){string name m_ components[index].GetType().Name.Substring(0, 4) _ components[index].name;property.FindPropertyRelative(name).stringValue name;}EditorGUI.PropertyField(f3Rect, property.FindPropertyRelative(name));EditorGUI.PropertyField(f4Rect, property.FindPropertyRelative(component));//当前挂载位置var parent property.serializedObject.targetObject.GetComponentTransform();var curgo go.GetComponentTransform();types.Clear();while (curgo ! parent curgo ! null){types.Add(curgo.name);curgo curgo.parent;}string path ;for (int i types.Count - 1; i 0; i--){path (types[i] (i ! 0 ? / : ));}property.FindPropertyRelative(path).stringValue path;EditorGUI.PropertyField(f5Rect, property.FindPropertyRelative(path));}else{EditorGUI.PropertyField(f2Rect, property.FindPropertyRelative(go));}} }[Serializable] public class OperateSetting { }[CustomPropertyDrawer(typeof(OperateSetting))] public class OperateSettingAEditor : PropertyDrawer {private Dictionarystring, ComponentInfo keyValuePairs new Dictionarystring, ComponentInfo();public override float GetPropertyHeight(SerializedProperty property, GUIContent label){return base.GetPropertyHeight(property, label) addHeight;}private float addHeight;private string repeatname;public override void OnGUI(Rect position, SerializedProperty property, GUIContent label){//UnityEditor.EditorGUILayout.Space(60);var uiCollector property.serializedObject.targetObject.GetComponentUICollector();if (string.IsNullOrEmpty(uiCollector.GenerateClassName)){uiCollector.GenerateClassName $_D_{uiCollector.transform.name.Replace(_d_, )};}if (GUI.Button(new Rect(position.x, position.y, position.width, 30), 生成CSharp)){uiCollector.GenerateMainClass();}if (uiCollector.components.Count 0){keyValuePairs.Clear();bool isRepeat false;foreach (var item in uiCollector.components){if (!keyValuePairs.ContainsKey(item.name)){keyValuePairs.Add(item.name,item);}else{//GUI.color Color.red; // 设置错误文本颜色为红色repeatname item.name;isRepeat true;break;}}if (isRepeat){GUI.Label(new Rect(position.x, position.y 30, position.width, 40), 重复提示 repeatname 字段重复, new GUIStyle());addHeight 40;}else{addHeight 30;}}} }#endregion
http://www.zqtcl.cn/news/722495/

相关文章:

  • 深圳网站建设怎么样微商城建设
  • 网站建设前台后台教程大安移动网站建设
  • 建设网站的程序国庆节网页设计素材
  • 彩票网站做代理人事外包公司
  • 免费的网站开发工具网站app开发
  • 厦门的服装商城网站建设语种网站建设
  • 云服务器怎么做网站东莞黄江网站建设
  • 地方网站模板德清县新巿镇城市建设网站
  • 昆明传媒网站建设模板兔自用WordPress
  • 高企达建设有限公司网站青村网站建设
  • 网站设计公司服务连锁品牌网站建设
  • 石家庄桥西网站制作公司wordpress 使用插件下载
  • 深圳外贸建站网络推广哪家好制造业小程序网站开发
  • 电子商务网站开发步骤宁波制作网站知名
  • 网站建设所需网站是别人做的 ftp账号吗
  • 网站集约化建设情况的汇报做网站为什么要买网站空间
  • 专业定制网站开发公司中堂东莞网站建设
  • 如何提交网站给百度建立类似淘宝的网站
  • 苏州企业建站公司网站建设属于广告费吗
  • 做网站找企业信息管理平台
  • 泉州企业制作网站网站建设竞价托管外包
  • 如何建立电子商务网站网站制作地点
  • 网站建设设计目的memcached wordpress
  • 潍坊作风建设年网站上海到北京火车时刻表查询
  • 网站建设 项目要求手机软件app
  • 什么是做网站wordpress 七牛视频
  • 家乡网站建设策划书angular做的网站
  • 土豆网网站开发源代码thinkphp5做的网站
  • lng企业自建站wordpress 分页 美化
  • 手机版网站如何做新闻类网站怎么做百度推广