/*internal static void UpdateHLInfo(List<h2Info> vList) { * * for (var i = 0;i < vList.Count; i++) { * var item = vList[i]; * if (item.goHLStatus != h2HLType.Unknown) continue; * * if (map.ContainsKey(item.instID)) { * var info = map[item.instID]; * item.goHLStatus = h2HLType.Highlight; * item.goHLColor = info.color; * continue; * } * * var p = item.go.transform.parent; * if (p == null) { * item.goHLStatus = h2HLType.None; * continue; * } * * var instID = p.gameObject.GetInstanceID(); * if (!map.ContainsKey(instID)) { * item.goHLStatus = h2HLType.None; * continue; * } * * var info1 = map[instID]; * * item.goHLStatus = h2HLType.DirectChildren; * item.goHLColor = info1.color.xAlpha(0.5f); * } * }*/ //static public void Repaint() { // MarkDirty(); // WindowX.Hierarchy.Repaint(); //} internal static h2GOHLInfo Get(GameObject go) { if (go == null) { return(null); } var vlbGO = VietLabsRT.Get <Hierarchy2RT> (false); if (vlbGO == null) { return(null); } var list = vlbGO.listHL; if (list == null) { return(null); } for (var i = 0; i < list.Count; i++) { if (list[i].go == go) { return(list[i]); } } return(null); }
internal static void ClearColor(GameObject go) { var vlbGO = VietLabsRT.Get <Hierarchy2RT> (false); if (vlbGO == null) { return; } vlbGO.listHL.RemoveAll(item => item.go == go); Refresh(); }
internal static void SetColor(GameObject go, Color c) { var hlInfo = Get(go); if (hlInfo == null) //new //Debug.Log("SetColor ---> " + instID + ":" + c); { VietLabsRT.Get <Hierarchy2RT>(true).listHL.Add(new h2GOHLInfo { go = go, c = c }); } else //change color ? { hlInfo.c = c; } Refresh(); }