Class TextureCreator
This class dynamically creates textures at runtime. For example, we take
textures like hexagons as input and print a variable number of pins onto it.
The class also uses the generated textures to create materials.
Inheritance
TextureCreator
Assembly: .dll
Syntax
public static class TextureCreator
Fields
hexagonCircMaterials
Declaration
public static Dictionary<int, Material> hexagonCircMaterials
Field Value
hexagonCircTexture
Declaration
private static Texture2D hexagonCircTexture
Field Value
Type |
Description |
Texture2D |
|
hexagonCircTextures
Declaration
public static Dictionary<int, Texture2D> hexagonCircTextures
Field Value
hexagonMaterials
Declaration
public static Dictionary<int, Material> hexagonMaterials
Field Value
hexagonTexture
Declaration
private static Texture2D hexagonTexture
Field Value
Type |
Description |
Texture2D |
|
hexagonTextures
Declaration
public static Dictionary<int, Texture2D> hexagonTextures
Field Value
pinBorderCircTextures3Pins1
Declaration
public static Dictionary<int, Texture2D> pinBorderCircTextures3Pins1
Field Value
pinBorderCircTextures3Pins2
Declaration
public static Dictionary<int, Texture2D> pinBorderCircTextures3Pins2
Field Value
pinBorderCircTextures5Pins1
Declaration
public static Dictionary<int, Texture2D> pinBorderCircTextures5Pins1
Field Value
pinBorderCircTextures5Pins2
Declaration
public static Dictionary<int, Texture2D> pinBorderCircTextures5Pins2
Field Value
pinBorderHexCircMaterials
Declaration
public static Dictionary<int, Material> pinBorderHexCircMaterials
Field Value
pinBorderHexMaterials
Declaration
public static Dictionary<int, Material> pinBorderHexMaterials
Field Value
pinBorderTextureEmpty
Declaration
public static Texture2D pinBorderTextureEmpty
Field Value
Type |
Description |
Texture2D |
|
pinBorderTextures3Pins1
Declaration
public static Dictionary<int, Texture2D> pinBorderTextures3Pins1
Field Value
pinBorderTextures3Pins2
Declaration
public static Dictionary<int, Texture2D> pinBorderTextures3Pins2
Field Value
pinBorderTextures5Pins1
Declaration
public static Dictionary<int, Texture2D> pinBorderTextures5Pins1
Field Value
pinBorderTextures5Pins2
Declaration
public static Dictionary<int, Texture2D> pinBorderTextures5Pins2
Field Value
pinTexture
Declaration
private static Texture2D pinTexture
Field Value
Type |
Description |
Texture2D |
|
transTexture
Declaration
private static Texture2D transTexture
Field Value
Type |
Description |
Texture2D |
|
Methods
GetHexagonBaseTextureWithPins(int, ViewType)
Creates a texture from one of the base hexagon textures
and dots which represent the pins.
The pins are merged on top of the original hexagon to get a figure with pins.
Declaration
private static Texture2D GetHexagonBaseTextureWithPins(int pinsPerSide, ViewType viewType)
Parameters
Type |
Name |
Description |
int |
pinsPerSide |
The amount of pins per side.
|
ViewType |
viewType |
The view type, e.g. the standard hexagon or the circular view.
Please only use Hexagonal and HexagonalCirc here (the hexagonal base grid view),
Circular (the graph view) is not meant to work.
|
Returns
Type |
Description |
Texture2D |
A texture containing a hexagon or circle based on
viewType with pinsPerSide pins
on each of its six edges.
|
GetHexagonWithPinsMaterial(int, ViewType)
Declaration
public static Material GetHexagonWithPinsMaterial(int pinsPerSide, ViewType viewType)
Parameters
Type |
Name |
Description |
int |
pinsPerSide |
The amount of pins per side.
|
ViewType |
viewType |
The view type, Hexagonal or HexagonalCirc, not Circular!
|
Returns
Type |
Description |
Material |
The material used to draw particles with
pinsPerSide pins in the hexagonal view type
viewType .
|
GetPinBorderMaterial(int, ViewType)
Declaration
public static Material GetPinBorderMaterial(int pinsPerSide, ViewType viewType)
Parameters
Type |
Name |
Description |
int |
pinsPerSide |
The amount of pins per side.
|
ViewType |
viewType |
The view type, Hexagonal or HexagonalCirc, not Circular!
|
Returns
Type |
Description |
Material |
A material that only renders pins, only while the
particle is not moving.
|
GetPinBorderTexture(int, bool, bool, int, bool, ViewType)
This thing creates a texture from a transparent texture and dots which represent the pins.
The pins are merged on top of the original transparent texture to get a texture with pins.
This is done to lay this texture with a mesh on top of the original hexagon, so we can fit
circuits in between the two meshes and give the impression that all is one connected component.
Declaration
private static Texture2D GetPinBorderTexture(int pinsPerSide, bool omitSide, bool omit3Pins, int omittedSide, bool isTex1, ViewType viewType)
Parameters
Type |
Name |
Description |
int |
pinsPerSide |
The amount of pins per side.
|
bool |
omitSide |
Whether one side's pins should be omitted.
|
bool |
omit3Pins |
Whether three pins should be omitted (the
omittedSide and the two neighboring sides).
|
int |
omittedSide |
The side of the omitted pin/s.
|
bool |
isTex1 |
Whether this is texture 1 of the 2 possible texture positions in the
final shader. One of the two textures is used for the stationary part and one for the
moving part during an animation.
|
ViewType |
viewType |
The type of the base hexagon texture. Circular and hexagonal forms
have different pin positions. Accepted inputs: Hexagonal or HexagonalCirc, but not Circular!
|
Returns
Type |
Description |
Texture2D |
A transparent texture with the specified pins.
|
GetPinBorderTextureEmpty()
Declaration
private static Texture2D GetPinBorderTextureEmpty()
Returns
Type |
Description |
Texture2D |
|