예제 #1
0
        public static ArcBuilder arc_builder(Vector3 first_point, bool convex, bool allow_self_intersections)
        {
            GameObject game_object = new GameObject("ArcBuilder");
            ArcBuilder result      = game_object.AddComponent <ArcBuilder>();

            result.point                    = result.previous_point = result.original_point = first_point;
            result.shape                    = PlanetariaShape.Create();
            result.must_be_convex           = convex; // must be a "convex hull"
            result.allow_self_intersections = allow_self_intersections;
            return(result);
        }
예제 #2
0
        public static LevelCreatorEditor.CreateShape draw_first_point(bool force_quit = false)
        {
            if (force_quit)
            {
                return(escape());
            }
            // MouseDown 1: create first corner of a shape
            if (Event.current.type == EventType.MouseDown && Event.current.button == 0)
            {
                temporary_arc = ArcBuilder.arc_builder(LevelCreatorEditor.get_mouse_position(), LevelCreatorEditor.is_field, LevelCreatorEditor.allow_self_intersections);
                return(draw_tangent);
            }

            return(draw_first_point);
        }
예제 #3
0
 private static void draw_arc_builder_gizmos(ArcBuilder self, GizmoType gizmo_type)
 {
     PlanetariaShapeEditor.draw_shape(self.shape, Quaternion.identity);
 }