Esempio n. 1
0
        public static EquilateralBuilder equilateral_builder(Vector3 center, int sides)
        {
            GameObject         game_object = new GameObject("EquilateralBuilder");
            EquilateralBuilder result      = game_object.AddComponent <EquilateralBuilder>();

            result.center = result.first_vertex = center;
            result.edges  = sides;
            result.shape  = create_equilateral(center, center, sides);
            return(result);
        }
        /// <summary>
        /// Mutator - MouseDown creates equilateral shape with center at mouse position
        /// </summary>
        /// <returns>The next mode for the state machine.</returns>
        public static LevelCreatorEditor.CreateShape draw_center(bool force_quit = false)
        {
            if (force_quit)
            {
                return(escape());
            }
            // MouseDown: create center of equilateral shape
            if (Event.current.type == EventType.MouseDown && Event.current.button == 0)
            {
                builder = EquilateralBuilder.equilateral_builder(LevelCreatorEditor.get_mouse_position(), LevelCreatorEditor.edges);
                return(draw_equilateral);
            }

            return(draw_center);
        }
Esempio n. 3
0
 static void draw_arc_builder_gizmos(EquilateralBuilder self, GizmoType gizmo_type)
 {
     PlanetariaShapeEditor.draw_shape(self.shape, self.gameObject.transform.rotation);
 }