Exemple #1
0
        private static void DoLookToActionParameters(Rect rect, GeoActionDataControl action)
        {
            var horiz = rect.Divide(2);
            var vert  = horiz[0].Divide(1, 2);

            EditorGUI.BeginChangeCheck();
            var newInside = GUI.Toggle(vert[0, 0], (bool)action["Inside"],
                                       "Geo.GeoElementWindow.Actions.Parameter.Inside".Traslate());

            if (EditorGUI.EndChangeCheck())
            {
                action["Inside"] = newInside;
            }

            EditorGUI.BeginChangeCheck();
            var newCenter = GUI.Toggle(vert[1, 0], (bool)action["Center"],
                                       "Geo.GeoElementWindow.Actions.Parameter.Center".Traslate());

            if (EditorGUI.EndChangeCheck())
            {
                action["Center"] = newCenter;
            }

            if (newCenter)
            {
                EditorGUI.BeginChangeCheck();
                var newDirection = RadialSlider.Do(horiz[1],
                                                   "Geo.GeoElementWindow.Actions.Parameter.Direction".Traslate(), (Vector2)action["Direction"]);
                if (EditorGUI.EndChangeCheck())
                {
                    action["Direction"] = newDirection;
                }
            }
        }
Exemple #2
0
        private static void DoEnterActionParameters(Rect rect, GeoActionDataControl action)
        {
            EditorGUI.BeginChangeCheck();
            var newFromOutside = GUI.Toggle(rect, (bool)action["OnlyFromOutside"],
                                            "Geo.GeoElementWindow.Actions.Parameter.OnlyFromOutside".Traslate());

            if (EditorGUI.EndChangeCheck())
            {
                action["OnlyFromOutside"] = newFromOutside;
            }
        }