private void ObjectInfoWindow_Update() { if (!showObjectInfoWindow) { return; } if (ScrollView_objectInfo_event.ItemID != -1 && ScrollView_objectInfo_event.MouseButton == 0) { current_objectInfo_index = ScrollView_objectInfo_event.ItemID; if (objectInfoText[current_objectInfo_index].Contains("UnityEngine.GameObject")) { showSetButton = true; } else { showSetButton = false; } } if (ScrollView_objectInfo_event.ItemID != -1 && ScrollView_objectInfo_event.MouseButton == 1) { int index = ScrollView_objectInfo_event.ItemID; if (IsBoolValue(index, out string name, out bool isProperty)) { if (isProperty) { ObjectProperty property = objectProperties.GetProperty(name); bool oldValue = (bool)property.GetValue(); property.SetValue(!oldValue); } else { ObjectField field = objectFields.GetField(name); bool oldValue = (bool)field.GetValue(); field.SetValue(!oldValue); } ObjectInfoWindow_Awake(objects[selected_component]); } } }
private void SwitchGameObject() { string[] splittedItem = objectInfoText[current_objectInfo_index].Split(new char[] { ' ', '=' }, StringSplitOptions.RemoveEmptyEntries); GameObject probeGO = null; try { if (probeGO == null) { probeGO = objectProperties.GetProperty(splittedItem[0]) as GameObject; } if (probeGO == null) { probeGO = objectFields.GetField(splittedItem[0]) as GameObject; } if (probeGO == null) { throw new Exception("Can't set this object!"); } else { OnBaseObjectChange(probeGO); } } catch { OutputWindow_Log(ERROR_TEXT[ERRORS.CANNOT_SWITCH_TO_OBJECT], LogType.Error, probeGO.name); } }