CreatePlane

Author: Michael Garforth.

Extended by Juan Manuel Palacios to include the Anchor parameter for diverse plane pivoting. Extended by Frogsbo to make hexagon lattice planes. Extended by Jason MacRae to add the two-sided plane option.

Description
This editor script creates a plane with the specified orientation, pivot point, number of segments for width & length, among others.

There is a second create plane script to make hexagon planes: /\/\/\ \/\/\/ /\/\/\

Usage
Place this script as "CreatePlane.cs" in YourProject/Assets/Editor and a menu item will automatically appear in the "GameObject/Create Other" menu after it is compiled.

Width Segments is the number of quads the plane will have in the X direction.

Length Segments is the number of quads the plane will have in the Z direction (or Y direction, for a vertically-oriented plane).

Width is the number of world units wide the plane will be. (Generally it's best to create objects at the correct scale natively, rather than scaling them afterward.)

Length is the number of world units long the plane will be (or how high, for a vertically-oriented plane).

Orientation is either Horizontal (flat) or Vertical (standing up), which can avoid having to rotate the plane afterward.

Anchor is the mesh point in the plane that will act as its pivot.

Add Collider creates a box collider for the plane if checked.

Two Sided creates a two sided plane. Can be useful for collision detection and for very thin objects that need to render both sides.

Create At Origin creates the plane at the origin (0,0,0) if checked; otherwise it's created a little ways in front of the editor camera.

It will create a mesh asset named either "Plane" or "OptionalName" in the "YourProject/Assets/Editor" folder. Appended to the name is the number of segments wide and long, plus the width, length and orientation.

C# - CreatePlane.cs
HEXAGON VERSION: