Hi to All,
can you help me on this part i try to make a textfield in Hierarchy Window. but this is could happen when i type a word or letter inside of textfield.
The Textfield have same Word or text.
Here’s the Code:
Code (CSharp):
- using UnityEditor;
- using UnityEngine;
- using System.Collections.Generic;
-
- [InitializeOnLoad]
- class MyHierarchyIcon
- {
- static List markedObjects;
-
- static MyHierarchyIcon ()
- {
- // Init
- EditorApplication.update += UpdateCB;
- EditorApplication.hierarchyWindowItemOnGUI += HierarchyItemCB;
- }
-
- static void UpdateCB ()
- {
- // Check here
- GameObject[ ] go = Object.FindObjectsOfType (typeof(GameObject)) as GameObject[ ];
- markedObjects = new List ();
- foreach (GameObject g in go)
- {
- if (g.GetComponent () != null)
- {
- markedObjects.Add (g.GetInstanceID ());
- }
- }
- }
- static string a = “”;
-
- static void HierarchyItemCB (int instanceID, Rect selectionRect)
- {
- if (markedObjects.Contains (instanceID))
- {
- // Draw the GUI
- a = GUILayout.TextField(a,25);
- }
- }
- }[/SIZE]
Thank you in Advance.
Go Unity Dev