MasterGH Опубликовано 5 мая, 2015 Поделиться Опубликовано 5 мая, 2015 Зачем вообще надо внедрять длл в Юнити игры? И что такое Моно? Например, я хочу сделать читы, посмотреть игровые объекты или очень сильно модифицировать игру, если это конечно не нарушает авторские права. Например, для просмотра названия объектов их компонентов я сделал такую штуку На Юнити3д будет все больше и больше появляться игрушек так, что кому-то будет интересным их поковырять. Моно образно это классы, функции и прочее на базе .net. Позволяет на многих устройствах играть в игры, а не только на компе. Но на компе можно внедрять длл с помощью CE. Принцип внедрения на высоком уровне рассматривался здесь здесь Дарк байт помог таким скриптом (ссылка). Я же его изменил и добавил немного своих комментариев. Зарядим .net dll например в Sharp Develop визуальной студии. Она будет показывать самописный инспектор и иерархию объектов. Но, а вы можете сделать dll проще, чтобы исполняла только читы Также хочу обратить внимание на, то что в CE Lua есть возможность обращаться к Mono функциям, а значит искать игровые объекты GameOjects искать в них компоненты по типу, получать поля и методы. Получив поле здоровья мы можем заморозить его из CE Lua. Подробнее пока только на офсайтеMonoDomain * domain = mono_jit_init(""); MonoAssembly* msCorlib = mono_domain_assembly_open (domain,"mscorlib"); MonoImage* image = mono_assembly_get_image(msCorlib); MonoClass *klass = mono_class_from_name (image, "System", "Exception"); MonoObject* o = mono_object_new (domain, klass); MonoMethodDesc* methodDesc = mono_method_desc_new("System.Object:ToString", TRUE); MonoMethod* toStringMethod = mono_method_desc_search_in_class(methodDesc, klass); MonoObject* result = mono_runtime_invoke(toStringMethod, o, NULL, NULL);[ENABLE]//mono_assembly_foreach //mono_assembly_getimage alloc(bla, 2048) alloc(testdllpath, 256); alloc(domain,4) alloc(image,4) alloc(classdef,4) alloc(classobject, 4) alloc(methodDesc,4) alloc(method,4) registersymbol(domain) registersymbol(image) registersymbol(classdef) registersymbol(classobject) registersymbol(methodDesc) registersymbol(method) alloc(result,4) registersymbol(result) alloc(result2,4) registersymbol(result2) alloc(strTestLib,64) alloc(strClass1,64) alloc(strSomething,64) alloc(params, 32) alloc(exception,4) registersymbol(exception) strTestLib: db 'NamespaceCheats',0 // пространство имени например NamespaceCheats strClass1: // Название класса db 'Cheats',0 strSomething: // Название метода db '*:Main',0 testdllpath: // Путь до dll db 'D:\Cheat.dll',0 bla: //foreach domain is useful too call mono.mono_get_root_domain mov [domain],eax push eax call mono.mono_thread_attach add esp,4 push testdllpath push [domain] call mono.mono_domain_assembly_open add esp,8 push eax call mono.mono_assembly_get_image add esp,4 mov [image],eax push strClass1 push strTestLib push eax call mono.mono_class_from_name add esp, c mov [classdef],eax //create a class push eax //classdef push [domain] call mono.mono_object_new add esp, 8 mov [classobject],eax push eax call mono.mono_runtime_object_init //execute the nameless constructor (if there is one) add esp,4 //find the method push 0 push strSomething call mono.mono_method_desc_new add esp,8 mov [methodDesc], eax push [classdef] push eax call mono.mono_method_desc_search_in_class add esp,8 mov [method], eax mov [params],0 push exception push params //no params push [classobject] push eax //[method] call mono.mono_runtime_invoke add esp,10 mov [result],eax ret result: dd 0 result2: dd 0 createthread(bla) [DISABLE]//code from here till the end of the code will be used to disable the cheatusing System;using UnityEngine;namespace NamespaceCheats{ public class Cheats { public static void Main() { new GameObject { name = "Cheats" }.AddComponent<LoadAsset>(); } }}public class LoadAsset : MonoBehaviour{ private void OnGUI() { GUI.Label(new Rect(0f, 10f, 500f, 30f), "Status: ON"); } private void Start() { GameObject gameObject = new GameObject(); gameObject.AddComponent<ProviderHierarchy>(); UnityEngine.Object.Destroy(base.gameObject); }}using System;using System.Collections;using System.Collections.Generic;using System.Reflection;using System.Text;using UnityEngine;public class ProviderHierarchy : MonoBehaviour{ public class Inspector { public class DataComponent { public bool hasEnabledState; public bool isUserComponent; public string nameComponent; public Component component; private bool cashStateEnabled; private bool cashWriteStateEnabled; private PropertyInfo propertyInfo; public bool enabled { get { return this.cashStateEnabled; } set { this.cashWriteStateEnabled = value; if (this.cashStateEnabled != this.cashWriteStateEnabled) { this.propertyInfo.SetValue(this.component, this.cashWriteStateEnabled, null); } } } public DataComponent(Component argComponent) { this.component = argComponent; string text = this.component.GetType().ToString(); if (text.Contains("UnityEngine.")) { text = text.Remove(0, "UnityEngine.".Length); } if (argComponent as MonoBehaviour != null) { this.isUserComponent = true; text += " (Script)"; } this.nameComponent = text; Type type = this.component.GetType(); this.propertyInfo = type.GetProperty("enabled"); this.hasEnabledState = (this.propertyInfo != null); if (this.hasEnabledState && this.propertyInfo != null) { this.cashStateEnabled = (this.cashWriteStateEnabled = (bool)this.propertyInfo.GetValue(this.component, null)); } } public void UpdateViewData() { if (this.hasEnabledState && this.component != null && this.propertyInfo != null) { this.cashStateEnabled = (bool)this.propertyInfo.GetValue(this.component, null); } } } public GameObject parentGameObject; public string parentGameObjectName; public List<ProviderHierarchy.Inspector.DataComponent> listComponents = null; private float cashTime; private bool cashStateEnabled; private bool cashWriteStateEnabled; public bool enabledGO { get { return this.cashStateEnabled; } set { this.cashWriteStateEnabled = value; if (this.cashStateEnabled != this.cashWriteStateEnabled) { if (this.parentGameObject != null) { this.parentGameObject.SetActiveRecursively(this.cashWriteStateEnabled); } } } } public Inspector(GameObject argParentGameObject) { this.parentGameObject = argParentGameObject; this.cashStateEnabled = (this.cashWriteStateEnabled = this.parentGameObject.active); this.parentGameObjectName = this.parentGameObject.name; Component[] components = this.parentGameObject.GetComponents<Component>(); this.listComponents = new List<ProviderHierarchy.Inspector.DataComponent>(); Component[] array = components; for (int i = 0; i < array.Length; i++) { Component argComponent = array[i]; ProviderHierarchy.Inspector.DataComponent item = new ProviderHierarchy.Inspector.DataComponent(argComponent); this.listComponents.Add(item); } } public void UpdateViewData() { this.cashTime += Time.deltaTime; if (this.cashTime > 0.3f) { this.cashTime = 0f; if (this.parentGameObject != null) { this.cashStateEnabled = this.parentGameObject.active; } foreach (ProviderHierarchy.Inspector.DataComponent current in this.listComponents) { current.UpdateViewData(); } } } } public class HierarchyData { public Transform tr; public bool isShow = true; public bool isCollapse; public string caption; public List<ProviderHierarchy.HierarchyData> tree = new List<ProviderHierarchy.HierarchyData>(); public GUIStyle privateGuiStyle; public Texture2D imagePlus; public Texture2D imageMinus; public int deeper = 0; public Rect rect; public HierarchyData(Rect rect, Transform tr, string caption, Texture2D imagePlus, Texture2D imageMinus, GUIStyle argGuiStyle, int deeper) { this.tr = tr; this.caption = caption; this.imagePlus = imagePlus; this.imageMinus = imageMinus; this.privateGuiStyle = argGuiStyle; this.deeper = deeper; this.rect = rect; } public void Add(ProviderHierarchy.HierarchyData data) { this.tree.Add(data); } public void Add(Rect rect, Transform tr, string caption, Texture2D imagePlus, Texture2D imageMinus, GUIStyle argGuiStyle, int deeper) { this.tree.Add(new ProviderHierarchy.HierarchyData(rect, tr, caption, imagePlus, imageMinus, argGuiStyle, deeper)); } public void Hide() { foreach (ProviderHierarchy.HierarchyData current in this.tree) { current.isShow = false; current.Hide(); } } public void Show() { foreach (ProviderHierarchy.HierarchyData current in this.tree) { current.isShow = true; if (!current.isCollapse) { current.Show(); } } } public static bool FindChildsStringToBuilder(List<Transform> childs, Transform parent, ref StringBuilder sb, ref int innerCount) { int num = innerCount; bool result = false; innerCount++; string text = string.Empty; for (int i = 0; i < innerCount; i++) { text += " "; } foreach (Transform current in childs) { if (current.parent == parent) { sb.Append(string.Format(" {0}|_{1}", text, current.gameObject.name)); ProviderHierarchy.HierarchyData.FindComponentsStringToBuilder(current, ref sb); ProviderHierarchy.HierarchyData.FindChildsStringToBuilder(childs, current, ref sb, ref innerCount); result = true; } } innerCount = num; return result; } public static void FindComponentsStringToBuilder(Transform parent, ref StringBuilder sb) { sb.Append(" ("); Component[] components = parent.GetComponents(typeof(Component)); Component[] array = components; for (int i = 0; i < array.Length; i++) { Component component = array[i]; sb.Append(component.ToString()); sb.Append(", "); } sb.Remove(sb.Length - 2, 2); sb.AppendLine(" )"); } } public GUISkin myGuiSkin; public bool isShowBtnCopyToBuffer; public bool isShowButtonFogState; private Color colorSelected = new Color32(62, 255, 239, 255); private Color colorSelectedNoActive = new Color32(113, 178, 173, 255); private Color colorNoActiveObject = new Color32(146, 146, 146, 255); private Color colorNull = new Color32(129, 0, 0, 255); private string caption = "Tree view"; private float timeUpdate = 5f; private float dx = 0.7f; private float dy = 1.72f; private float dx1 = 10f; private float dy1 = 12.45f; private Texture2D imagePlus = null; private Texture2D imageMinus = null; private Rect rectPosition = new Rect(30f, 30f, 350f, 500f); private Rect rectView = new Rect(30f, 0f, 40f, 500f); private Rect rectInspector = new Rect(388f, 30f, 247f, 500f); private bool isCopyText; private bool isHierarchy; private bool isInSpector = true; private bool isHide; private float lstTime; private float viewHeight; private Rect parentRect; private Rect bottomPanel; private Vector2 scrollView; private ProviderHierarchy.HierarchyData treeData = null; private List<Transform> trList = new List<Transform>(); private ProviderHierarchy.HierarchyData selectedHierarchyData; private List<ProviderHierarchy.HierarchyData> listFroward = new List<ProviderHierarchy.HierarchyData>(); private List<ProviderHierarchy.HierarchyData> cashFroward = new List<ProviderHierarchy.HierarchyData>(); private ProviderHierarchy.Inspector inspector = null; private float bottomHeight = 30f; private float resizeGUITime; private GUIStyle privateGuiStyle; private GameObject herold = null; private CharacterController characterController; private GameObject gameCamera = null; private bool heroldCheat; private bool isMovingLeft; private bool isMovingRight; private float currentSpeed = 5f; private Vector3 deltaCameraPosition; private bool isBeginUpdate; private void FillInspector(Transform transformselected) { this.inspector = new ProviderHierarchy.Inspector(transformselected.gameObject); } private void Awake() { UnityEngine.Object.DontDestroyOnLoad(this); } private void OnLevelWasLoaded() { this.UpdateTreeView(); } private IEnumerator Start() { this.bottomPanel = new Rect(0f, (float)Screen.height - 30f, (float)Screen.width, 30f); this.privateGuiStyle = new GUIStyle(); this.privateGuiStyle.normal.textColor = Color.white; this.privateGuiStyle.fontSize = 22; this.privateGuiStyle.fontStyle = FontStyle.Normal; this.privateGuiStyle.alignment = TextAnchor.MiddleLeft; this.privateGuiStyle.wordWrap = false; this.privateGuiStyle.imagePosition = ImagePosition.ImageLeft; this.privateGuiStyle.fixedHeight = 20f; this.timeUpdate = 10000f; this.dx = 0f; this.dy = 30f; this.dx1 = 10f; this.dy = 20f; this.caption = "Tree view"; this.rectPosition = new Rect(30f, 30f, 350f, 500f); this.rectView = new Rect(30f, 0f, 450f, 500f); this.rectInspector = new Rect(388f, 30f, 247f, 500f); this.myGuiSkin = ScriptableObject.CreateInstance<GUISkin>(); this.myGuiSkin.button.onFocused.textColor = new Color32(0, 0, 0, 255); this.myGuiSkin.button.border = new RectOffset(6, 6, 46, 4); this.myGuiSkin.button.margin = new RectOffset(4, 4, 4, 4); this.myGuiSkin.button.padding = new RectOffset(6, 6, 3, 3); this.myGuiSkin.button.normal.textColor = new Color32(255, 141, 34, 255); this.myGuiSkin.button.fontSize = 23; this.myGuiSkin.button.alignment = TextAnchor.MiddleCenter; this.myGuiSkin.button.wordWrap = false; this.myGuiSkin.button.imagePosition = ImagePosition.TextOnly; this.myGuiSkin.button.stretchWidth = false; this.myGuiSkin.button.stretchHeight = false; this.myGuiSkin.customStyles = new GUIStyle[0]; WWW wWW = new WWW("file://localhost//D://Minus.png"); // создайте свою иконку узла в TreeView yield return wWW; this.imageMinus = wWW.texture; WWW wWW2 = new WWW("file://localhost//D://Plus.png");// создайте свою иконку узла в TreeView yield return wWW2; this.imagePlus = wWW2.texture; this.UpdateTreeView(); yield break; } private void IncreacedZoomGUI() { this.myGuiSkin.button.fontSize++; this.privateGuiStyle.fontSize++; } private void DecreasedZoomGUI() { this.myGuiSkin.button.fontSize--; this.privateGuiStyle.fontSize--; } private void OnGUI() { if (this.isHide) { GUILayout.BeginArea(this.bottomPanel); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button("Tools", this.myGuiSkin.button, new GUILayoutOption[] { GUILayout.Width(120f) })) { this.isHide = !this.isHide; } GUILayout.EndHorizontal(); GUILayout.EndArea(); } else { GUILayout.BeginArea(this.bottomPanel); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button("Hierarchy", this.myGuiSkin.button, new GUILayoutOption[0])) { this.isHierarchy = !this.isHierarchy; } this.resizeGUITime += Time.deltaTime; if (this.resizeGUITime > 1f && Event.current.type == EventType.Repaint) { this.resizeGUITime = 0f; this.bottomHeight = GUILayoutUtility.GetLastRect().height; this.bottomPanel.y = (float)Screen.height - this.bottomHeight; this.bottomPanel.width = (float)Screen.width; this.bottomPanel.height = this.bottomHeight; } GUILayout.Space(5f); GUI.enabled = this.isHierarchy; if (GUILayout.Button("Inspector", this.myGuiSkin.button, new GUILayoutOption[0])) { this.isInSpector = !this.isInSpector; if (this.isInSpector) { if (this.selectedHierarchyData != null && this.selectedHierarchyData.tr != null) { this.FillInspector(this.selectedHierarchyData.tr); } } } GUILayout.Space(5f); GUI.enabled = true; if (this.isShowBtnCopyToBuffer) { if (GUILayout.Button("Hierarchy Coppy To Buffer", this.myGuiSkin.button, new GUILayoutOption[0])) { Type typeFromHandle = typeof(GUIUtility); PropertyInfo property = typeFromHandle.GetProperty("systemCopyBuffer", BindingFlags.Static | BindingFlags.NonPublic); property.SetValue(null, this.GetTextInfo().ToString(), null); } } GUILayout.Space(5f); if (this.isShowButtonFogState) { if (GUILayout.Button("FOG state", this.myGuiSkin.button, new GUILayoutOption[0])) { RenderSettings.fog = !RenderSettings.fog; } } GUILayout.Space(5f); if (GUILayout.Button("GUI+", this.myGuiSkin.button, new GUILayoutOption[0])) { this.IncreacedZoomGUI(); } GUILayout.Space(5f); if (GUILayout.Button("GUI-", this.myGuiSkin.button, new GUILayoutOption[0])) { this.DecreasedZoomGUI(); } GUILayout.Space(5f); if (GUILayout.Button("Update", this.myGuiSkin.button, new GUILayoutOption[0])) { this.UpdateTreeView(); } GUILayout.Space(5f); if (GUILayout.Button("HIDE", this.myGuiSkin.button, new GUILayoutOption[0])) { this.isHide = !this.isHide; } GUILayout.EndHorizontal(); GUILayout.EndArea(); if (this.treeData != null && !this.isCopyText && !this.isBeginUpdate) { if (this.isHierarchy) { GUI.Box(this.rectPosition, this.caption); this.rectView.height = this.parentRect.y + 10f; this.scrollView = GUI.BeginScrollView(this.rectPosition, this.scrollView, this.rectView, true, true); float num = 0f; float num2 = 0f; Color contentColor = GUI.contentColor; foreach (ProviderHierarchy.HierarchyData current in this.listFroward) { if (current.isShow) { num2 += this.dy; Rect position = new Rect(current.rect); position.y += num; if (current.tree.Count > 0) { Rect position2 = new Rect(position.x, position.y, 16f, 16f); if (GUI.Button(position2, (!current.isCollapse) ? this.imageMinus : this.imagePlus, this.privateGuiStyle)) { if (current.tree.Count > 0) { if (current.isCollapse) { current.isCollapse = false; current.Show(); } else { current.isCollapse = true; current.Hide(); } } } } position.x += 20f; position.y -= 2f; if (this.selectedHierarchyData == current) { if (current != null && current.tr != null) { GUI.contentColor = (current.tr.gameObject.active ? this.colorSelected : this.colorSelectedNoActive); } else { GUI.contentColor = this.colorNull; } } else { if (current != null && current.tr != null) { GUI.contentColor = (current.tr.gameObject.active ? contentColor : this.colorNoActiveObject); } else { GUI.contentColor = this.colorNull; } } if (GUI.Button(position, current.caption, this.privateGuiStyle)) { this.selectedHierarchyData = current; if (this.selectedHierarchyData != null && this.selectedHierarchyData.tr != null) { this.FillInspector(this.selectedHierarchyData.tr); } } if (GUI.contentColor != contentColor) { GUI.contentColor = contentColor; } } else { num -= this.dy; } } if (num2 < this.rectPosition.height) { num2 = this.rectPosition.height; } this.viewHeight = num2; GUI.EndScrollView(); if (this.isInSpector) { GUI.Box(this.rectInspector, string.Empty); if (this.inspector != null) { GUILayout.BeginArea(this.rectInspector); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button(this.inspector.enabledGO ? this.imagePlus : this.imageMinus, this.privateGuiStyle, new GUILayoutOption[0])) { this.inspector.enabledGO = !this.inspector.enabledGO; } this.inspector.enabledGO = GUILayout.Toggle(this.inspector.enabledGO, this.inspector.parentGameObjectName, this.privateGuiStyle, new GUILayoutOption[0]); GUILayout.EndHorizontal(); Color color = GUI.color; foreach (ProviderHierarchy.Inspector.DataComponent current2 in this.inspector.listComponents) { if (current2.isUserComponent) { GUI.color = Color.green; } if (!current2.hasEnabledState) { GUILayout.Label(current2.nameComponent, this.privateGuiStyle, new GUILayoutOption[0]); } else { GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button(current2.enabled ? this.imagePlus : this.imageMinus, this.privateGuiStyle, new GUILayoutOption[0])) { current2.enabled = !current2.enabled; } current2.enabled = GUILayout.Toggle(current2.enabled, current2.nameComponent, this.privateGuiStyle, new GUILayoutOption[0]); GUILayout.EndHorizontal(); } GUI.color = color; } GUILayout.EndVertical(); GUILayout.EndArea(); } } } } } } private void Update() { if (Input.GetMouseButton(0)) { Screen.lockCursor = false; Screen.set_showCursor(true); } if (this.inspector != null) { this.inspector.UpdateViewData(); } this.parentRect.y = this.viewHeight + 20f; if (!this.isCopyText) { this.lstTime += Time.deltaTime; if (this.lstTime > this.timeUpdate) { this.lstTime = 0f; this.UpdateTreeView(); } } } private void UpdateTreeView() { this.isBeginUpdate = true; bool flag = this.listFroward != null && this.listFroward.Count > 0; if (flag) { this.cashFroward.Clear(); foreach (ProviderHierarchy.HierarchyData current in this.listFroward) { this.cashFroward.Add(current); } } UnityEngine.Object[] array = UnityEngine.Object.FindObjectsOfType(typeof(GameObject)); this.trList = new List<Transform>(); UnityEngine.Object[] array2 = array; for (int i = 0; i < array2.Length; i++) { UnityEngine.Object @object = array2[i]; if ((@object as GameObject).name != "Hack_Tools") { this.trList.Add((@object as GameObject).transform); } } if (flag) { foreach (ProviderHierarchy.HierarchyData current2 in this.cashFroward) { if (current2.tr != null && current2.tr.parent == null && !current2.tr.gameObject.active) { bool flag2 = false; foreach (Transform current3 in this.trList) { if (current3 == current2.tr) { flag2 = true; break; } } if (!flag2) { this.trList.Add(current2.tr); } } } } List<Transform> list = new List<Transform>(); List<Transform> list2 = new List<Transform>(); foreach (Transform current3 in this.trList) { if (current3.parent == null) { list.Add(current3); } else { list2.Add(current3); } } this.parentRect = new Rect(this.rectPosition.x + 10f, 20f, this.rectPosition.width - 10f, this.rectPosition.height - 10f); this.treeData = new ProviderHierarchy.HierarchyData(new Rect(this.parentRect.x + this.dx + 0f * this.dx1, 0f, this.parentRect.width, this.dy1), null, "Game Objects", this.imageMinus, this.imageMinus, this.privateGuiStyle, 0); this.listFroward.Clear(); foreach (Transform current4 in list) { ProviderHierarchy.HierarchyData hierarchyData = new ProviderHierarchy.HierarchyData(new Rect(this.parentRect.x + this.dx + 1f * this.dx1, this.parentRect.y, this.parentRect.width, this.dy1), current4, current4.gameObject.name, this.imagePlus, this.imageMinus, this.privateGuiStyle, 1); this.treeData.Add(hierarchyData); this.listFroward.Add(hierarchyData); this.FindChilds(list2, hierarchyData, 2); this.parentRect.y = this.parentRect.y + this.dy; } this.isBeginUpdate = false; if (flag) { foreach (ProviderHierarchy.HierarchyData current2 in this.cashFroward) { foreach (ProviderHierarchy.HierarchyData current in this.listFroward) { if (current.tr == current2.tr) { if (current2.isCollapse) { current.isCollapse = true; current.Hide(); } } } } } } private void FindChilds(List<Transform> childs, ProviderHierarchy.HierarchyData parentData, int currentDeeper) { Transform tr = parentData.tr; foreach (Transform current in childs) { if (current.parent == tr) { this.parentRect.y = this.parentRect.y + this.dy; ProviderHierarchy.HierarchyData hierarchyData = new ProviderHierarchy.HierarchyData(new Rect(this.parentRect.x + this.dx + (float)currentDeeper * this.dx1, this.parentRect.y, this.parentRect.width, this.dy1), current, current.gameObject.name, this.imageMinus, this.imageMinus, this.privateGuiStyle, currentDeeper + 3); parentData.Add(hierarchyData); this.listFroward.Add(hierarchyData); this.FindChilds(childs, hierarchyData, currentDeeper + 1); } } } private StringBuilder GetTextInfo() { StringBuilder stringBuilder = new StringBuilder(); this.isCopyText = true; UnityEngine.Object[] array = UnityEngine.Object.FindObjectsOfType(typeof(GameObject)); this.trList = new List<Transform>(); UnityEngine.Object[] array2 = array; for (int i = 0; i < array2.Length; i++) { UnityEngine.Object @object = array2[i]; this.trList.Add((@object as GameObject).transform); } List<Transform> list = new List<Transform>(); List<Transform> list2 = new List<Transform>(); foreach (Transform current in this.trList) { if (current.parent == null) { list.Add(current); } else { list2.Add(current); } } this.parentRect = new Rect(this.rectPosition.x + 10f, this.rectPosition.y, this.rectPosition.width - 10f, this.rectPosition.height - 10f); this.treeData = new ProviderHierarchy.HierarchyData(new Rect(this.parentRect.x + this.dx + 0f * this.dx1, this.parentRect.y + this.dy, this.parentRect.width, this.dy1), null, "Game Objects", this.imageMinus, this.imageMinus, this.privateGuiStyle, 0); int num = 0; foreach (Transform current2 in list) { stringBuilder.AppendLine(string.Format(" {0}", current2.gameObject.name)); num = 0; ProviderHierarchy.HierarchyData.FindChildsStringToBuilder(list2, current2, ref stringBuilder, ref num); } this.isCopyText = false; return stringBuilder; }} Ссылка на комментарий Поделиться на другие сайты Поделиться
Рекомендуемые сообщения