void Update() { // the selecting should be performed outside OnGUI() to prevent exception below: // ArgumentException: control 1's position in group with only 1 control // http://answers.unity3d.com/questions/240913/argumentexception-getting-control-1s-position-in-a.html // http://answers.unity3d.com/questions/400454/argumentexception-getting-control-0s-position-in-a-1.html if (_inspector != null && _selectedThing != _inspector.Selected) { switch (m_selectedView) { case eShowType.InTable: if (_tableBrowser != null) { _tableBrowser.SelectThing(_selectedThing); } break; case eShowType.InTreemap: if (_treeMapView != null) { _treeMapView.SelectThing(_selectedThing); } break; default: break; } if (_inspector != null) { _inspector.SelectThing(_selectedThing); } } }
public void SelectThing(ThingInMemory thing) { _inspector.SelectThing(thing); _treeMapView.SelectThing(thing); }