public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { DistanceAttribute distanceAttribute = attribute as DistanceAttribute; Rect r1 = new Rect(position.x, position.y, position.width, position.height / nbElement); Rect r2 = new Rect(position.x, position.y + position.height / nbElement, position.width, position.height / nbElement); EditorGUI.PropertyField(r1, property); if (distanceAttribute.DisplayDistance) { EditorGUI.LabelField(r2, DistanceFormat(property.intValue)); } }
//Initialize Model, view and Listeners private void Start() { querylist = new List <POICoordinatesObject>(); view = transform.GetChild(7).GetComponent <QueryMenuView>(); resultmodel = GetComponent <ResultPanelController>().GETResultPanelModel(); distanceAttribute = transform.GetChild(7).GetChild(6).GetChild(0).GetChild(1) .GetComponent <DistanceAttribute>(); PointOfInterests = new List <Coordinates>(); myLocation = new Coordinates(0, 0); // Listen to input from the view view.OnRemove += RemoveFromDatabase; view.OnReceived += SearchQuery; //view.OnSearch += SearchDebug; view.OnSearch += SearchClicked; view.OnErrorBack += HandleError; DistanceAttribute.OnDistanceChanged += UpdateDistance; // Listen to changes in the model }