Esempio n. 1
0
        public override void Draw(int aID)
        {
            workingGeoElement = Target as GeoElementDataControl ?? GeoController.Instance.GeoElements.DataControls[GeoController.Instance.SelectedGeoElement];


            // -------------
            // Documentation
            // -------------

            GUILayout.Label(TC.get("Item.Documentation"));
            EditorGUI.BeginChangeCheck();
            var documentation = GUILayout.TextArea(workingGeoElement.Documentation ?? string.Empty);

            if (EditorGUI.EndChangeCheck())
            {
                workingGeoElement.Documentation = documentation;
            }


            // -------------
            // Descriptions
            // -------------
            descriptionsEditor.Descriptions = workingGeoElement.DescriptionController;
            descriptionsEditor.OnInspectorGUI();
            GUILayout.Space(20);
        }
Esempio n. 2
0
        public override void Draw(int aID)
        {
            var isInspector = Target != null;

            if (isInspector)
            {
                m_Rect.height = 300;
            }

            workingGeoElement = Target as GeoElementDataControl ?? GeoController.Instance.GeoElements.DataControls[GeoController.Instance.SelectedGeoElement];

            // -------------
            // Actions
            // -------------
            geoActionsList.SetData(workingGeoElement.GeoActions, ge => (ge as ListDataControl <GeoElementDataControl, GeoActionDataControl>).DataControls.Cast <DataControl>().ToList());
            geoActionsList.DoList(m_Rect.height - 60f);
        }
Esempio n. 3
0
        protected override void DrawInspector()
        {
            var isInspector = Target != null;

            workingGeoElement = Target as GeoElementDataControl ?? GeoController.Instance.GeoElements.DataControls[GeoController.Instance.SelectedGeoElement];

            geometriesList.SetData(workingGeoElement.GMLGeometries, g => (g as ListDataControl <GeoElementDataControl, GMLGeometryDataControl>).DataControls.Cast <DataControl>().ToList());
            geometriesList.DoList(120);

            var geometry = workingGeoElement.GMLGeometries[workingGeoElement.SelectedGeometry];

            // Geometry type
            EditorGUI.BeginChangeCheck();
            GUILayout.Label("Geo.GeoElement.Geometry.Type.Title".Traslate());
            var newType = (GMLGeometry.GeometryType)GUILayout.Toolbar((int)geometry.Type, typeNames);

            if (EditorGUI.EndChangeCheck())
            {
                geometry.CurrentEditor = MapEditor.Current ?? componentBasedEditor;
                geometry.Type          = newType;
            }

            // Geometry points
            EditorGUILayout.LabelField("Geo.GeoElement.Geometry.PointsCount".Traslate(geometry.Points.Length.ToString()));
            ActionSelected = GUILayout.Toolbar(ActionSelected, actions);

            // Geometry influence
            EditorGUI.BeginChangeCheck();
            var newInfluence = EditorGUILayout.FloatField("Geo.GeoElement.Geometry.Influence".Traslate(), geometry.Influence);

            if (EditorGUI.EndChangeCheck())
            {
                geometry.Influence = newInfluence;
            }

            if (GUILayout.Button("Geo.GeoElement.Geometry.Center".Traslate()) && geometry.Points.Length > 0)
            {
                Center(geometry);
            }
        }