Detailed Description

A mesh made up of a dynamic number of "blocks". Each block always consists of two triangles and 4 vertices. This is used for displaying the content in 3D with a single mesh.

Public Member Functions

 DynamicMesh (UIBatch batch)
 Creates a new dynamic mesh which uses the hybrid shader and a texture atlas. More...
 
void SetFontAtlas (TextureAtlas atlas)
 Changes the font atlas used by the default material. More...
 
void SetGraphicsAtlas (TextureAtlas atlas)
 Sets a default material to this mesh. More...
 
void SetGlobalMaterial ()
 
void SetMaterial (Material material)
 Applies the given material to this mesh. More...
 
void RequireNormals ()
 Let the mesh know that normals are required. More...
 
void RequireTangents ()
 Let the mesh know that tangents are required. More...
 
void ChangeParent ()
 Called to update the parenting of this mesh. More...
 
void SetPhysicsMode (bool physics)
 Called to tell this mesh to update which input mode its working in. E.g. this may revert this mesh from screen mode to physics mode, or vice versa. More...
 
void PrepareForLayout ()
 Let the mesh know it's about to undergo a layout routine. PowerUI.Renderman.Layout. More...
 
void CompletedLayout ()
 Let the mesh know a layout routine was completed. PowerUI.Renderman.Layout. More...
 
MeshBlock Allocate ()
 Allocates a block from this mesh. The block can then have its vertices/triangles edited. Changes will be outputted visually when PowerUI.DynamicMesh.Flush is called. More...
 
void Flush ()
 Outputs all the verts/triangles etc to the underlying unity mesh. More...
 
void Destroy ()
 Permanently destroys this mesh. More...
 

Public Attributes

UIBatch Batch
 The batch this mesh belongs to. More...
 
int BlockCount
 The number of blocks that have been allocated. More...
 
Mesh OutputMesh
 The unity mesh that this will be flushed into. More...
 
Material Material
 The material to use when rendering. More...
 
MeshBlock LastBlock
 The tail of the linked list of all allocated blocks. More...
 
MeshBlock FirstBlock
 The head of the linked list of all allocated blocks. More...
 
Transform OutputTransform
 The transform of this mesh. More...
 
GameObject OutputGameObject
 The gameobjec that holds this mesh. More...
 
FixedSizeBuffer< Vector2 > UV
 An array of uv coordinates. More...
 
FixedSizeBuffer< Vector2 > UV2
 An array of uv coordinates. More...
 
FixedSizeBuffer< int > Triangles
 An array of triangles. More...
 
FixedSizeBuffer< Color > Colours
 An array of vertex colours. More...
 
FixedSizeBuffer< Vector3 > Normals
 An array of normals. More...
 
FixedSizeBuffer< Vector3 > Vertices
 An array of vertex coordinates. More...
 
FixedSizeBuffer< Vector4 > Tangents
 An array of tangent values. More...
 
MeshCollider FullPhysicsModeCollider
 The collider that receives clicks in physics mode. More...
 

Static Public Attributes

static Shader UIShader
 The Hybrid GUI Shader. Set on demand. More...
 

Private Member Functions

void Setup ()
 Called only by constructors. This creates the actual mesh and the buffers for verts/tris etc. More...
 

Private Attributes

int LastBlockCount
 The number of blocks that were allocated last UI update. More...
 
MeshRenderer Renderer
 The renderer being used to layout the blocks. More...
 
Material GlobalMaterial
 The material used by this mesh when it is using an atlas. More...
 

Constructor & Destructor Documentation

PowerUI.DynamicMesh.DynamicMesh ( UIBatch  batch)
inline

Creates a new dynamic mesh which uses the hybrid shader and a texture atlas.

Member Function Documentation

MeshBlock PowerUI.DynamicMesh.Allocate ( )
inline

Allocates a block from this mesh. The block can then have its vertices/triangles edited. Changes will be outputted visually when PowerUI.DynamicMesh.Flush is called.

void PowerUI.DynamicMesh.ChangeParent ( )
inline

Called to update the parenting of this mesh.

void PowerUI.DynamicMesh.CompletedLayout ( )
inline

Let the mesh know a layout routine was completed. PowerUI.Renderman.Layout.

void PowerUI.DynamicMesh.Destroy ( )
inline

Permanently destroys this mesh.

void PowerUI.DynamicMesh.Flush ( )
inline

Outputs all the verts/triangles etc to the underlying unity mesh.

void PowerUI.DynamicMesh.PrepareForLayout ( )
inline

Let the mesh know it's about to undergo a layout routine. PowerUI.Renderman.Layout.

void PowerUI.DynamicMesh.RequireNormals ( )
inline

Let the mesh know that normals are required.

void PowerUI.DynamicMesh.RequireTangents ( )
inline

Let the mesh know that tangents are required.

void PowerUI.DynamicMesh.SetFontAtlas ( TextureAtlas  atlas)
inline

Changes the font atlas used by the default material.

void PowerUI.DynamicMesh.SetGlobalMaterial ( )
inline
void PowerUI.DynamicMesh.SetGraphicsAtlas ( TextureAtlas  atlas)
inline

Sets a default material to this mesh.

void PowerUI.DynamicMesh.SetMaterial ( Material  material)
inline

Applies the given material to this mesh.

Parameters
materialThe material to apply.
void PowerUI.DynamicMesh.SetPhysicsMode ( bool  physics)
inline

Called to tell this mesh to update which input mode its working in. E.g. this may revert this mesh from screen mode to physics mode, or vice versa.

void PowerUI.DynamicMesh.Setup ( )
inlineprivate

Called only by constructors. This creates the actual mesh and the buffers for verts/tris etc.

Member Data Documentation

UIBatch PowerUI.DynamicMesh.Batch

The batch this mesh belongs to.

int PowerUI.DynamicMesh.BlockCount

The number of blocks that have been allocated.

FixedSizeBuffer<Color> PowerUI.DynamicMesh.Colours

An array of vertex colours.

MeshBlock PowerUI.DynamicMesh.FirstBlock

The head of the linked list of all allocated blocks.

MeshCollider PowerUI.DynamicMesh.FullPhysicsModeCollider

The collider that receives clicks in physics mode.

Material PowerUI.DynamicMesh.GlobalMaterial
private

The material used by this mesh when it is using an atlas.

MeshBlock PowerUI.DynamicMesh.LastBlock

The tail of the linked list of all allocated blocks.

int PowerUI.DynamicMesh.LastBlockCount
private

The number of blocks that were allocated last UI update.

Material PowerUI.DynamicMesh.Material

The material to use when rendering.

FixedSizeBuffer<Vector3> PowerUI.DynamicMesh.Normals

An array of normals.

GameObject PowerUI.DynamicMesh.OutputGameObject

The gameobjec that holds this mesh.

Mesh PowerUI.DynamicMesh.OutputMesh

The unity mesh that this will be flushed into.

Transform PowerUI.DynamicMesh.OutputTransform

The transform of this mesh.

MeshRenderer PowerUI.DynamicMesh.Renderer
private

The renderer being used to layout the blocks.

FixedSizeBuffer<Vector4> PowerUI.DynamicMesh.Tangents

An array of tangent values.

FixedSizeBuffer<int> PowerUI.DynamicMesh.Triangles

An array of triangles.

Shader PowerUI.DynamicMesh.UIShader
static

The Hybrid GUI Shader. Set on demand.

FixedSizeBuffer<Vector2> PowerUI.DynamicMesh.UV

An array of uv coordinates.

FixedSizeBuffer<Vector2> PowerUI.DynamicMesh.UV2

An array of uv coordinates.

FixedSizeBuffer<Vector3> PowerUI.DynamicMesh.Vertices

An array of vertex coordinates.