2024年1月1日发(作者:)
然后是UGuiForm
{ // 注释列 continue; } if (lumn(i)) { // 编号列 Line(" m_Id = t32();"); continue; } Format(" {0} = {1}();", e(i), e(i).Name).Ap } stringBuilder .AppendLine(" }") .AppendLine(" }") .AppendLine() .AppendLine(" GeneratePropertyArray();") .AppendLine(" return true;") .Append(" }"); return ng(); } private static string GenerateDataTableStreamParser(DataTableProcessor dataTableProcessor) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder .AppendLine(" public override bool ParseDataRow(GameFrameworkSegment
PropertyCollection propertyCollection = null; foreach (PropertyCollection pc in propertyCollections) { if ( == propertyCollectionName) { propertyCollection = pc; break; } } if (propertyCollection == null) { propertyCollection = new PropertyCollection(propertyCollectionName, guageKeyword(i)); (propertyCollection); } m(id, name); } StringBuilder stringBuilder = new StringBuilder(); bool firstProperty = true; foreach (PropertyCollection propertyCollection in propertyCollections) { if (firstProperty) { firstProperty = false; } else { Line().AppendLine(); } stringBuilder .AppendFormat(" private KeyValuePair
.AppendLine(" private void GeneratePropertyArray()") .AppendLine(" {"); firstProperty = true; foreach (PropertyCollection propertyCollection in propertyCollections) { if (firstProperty) { firstProperty = false; } else { Line().AppendLine(); } stringBuilder .AppendFormat(" m_{0} = new KeyValuePair
public int ItemCount { get { return m_; } } public KeyValuePair
//------------------------------------------------------------using GameFramework;using System;using nt;using GameMain;using UnityEngine;using e;namespace ble{ public static class DataTableExtension { //CSharp类的前置命名空间 private const string DataRowClassPrefixName = ""; internal const char DataSplitSeparator = 't'; internal const char DataTrimSeparator = '"'; public static void LoadDataTable(this DataTableComponent dataTableComponent, string dataTableName, LoadType loadType, object userData = null) { if (OrEmpty(dataTableName)) { g("Data table name is invalid."); return; } string[] splitNames = ('_'); if ( > 2) { g("Data table name is invalid."); return; } string dataRowClassName = DataRowClassPrefixName + splitNames[0]; Type dataRowType = e(dataRowClassName); if (dataRowType == null) { g("Can not get data row type with class name '{0}'.", dataRowClassName); return; } string dataTableNameInType = > 1 ? splitNames[1] : null; taTable(dataRowType, dataTableName, dataTableNameInType, aTableAsset(dataTableName, loadType), loadType, bleAsset, userData); } public static Color32 ParseColor32(string value) { string[] splitValue = (','); return new Color32((splitValue[0]), (splitValue[1]), (splitValue[2]), (splitValue[3])); } public static Color ParseColor(string value) { string[] splitValue = (','); return new Color((splitValue[0]), (splitValue[1]), (splitValue[2]), (splitValue[3])); } public static Quaternion ParseQuaternion(string value) {
string[] splitValue = (','); return new Quaternion((splitValue[0]), (splitValue[1]), (splitValue[2]), (splitValue[3])); } public static Rect ParseRect(string value) { string[] splitValue = (','); return new Rect((splitValue[0]), (splitValue[1]), (splitValue[2]), (splitValue[3])); } public static Vector2 ParseVector2(string value) { string[] splitValue = (','); return new Vector2((splitValue[0]), (splitValue[1])); } public static Vector3 ParseVector3(string value) { string[] splitValue = (','); return new Vector3((splitValue[0]), (splitValue[1]), (splitValue[2])); } public static Vector4 ParseVector4(string value) { string[] splitValue = (','); return new Vector4((splitValue[0]), (splitValue[1]), (splitValue[2]), (splitValue[3])); } }}


发布评论