// CONSTRUCTOR public QMazePiece(QMazePieceType type, bool require, bool use, float frequency, List<QMazeOutput> outputList) { this.type = type; this.require = require; this.use = use; this.frequency = frequency; this.outputList = outputList; }
// CONSTRUCTOR public QMazePiece(QMazePieceType type, bool require, bool use, float frequency, List <QMazeOutput> outputList) { this.type = type; this.require = require; this.use = use; this.frequency = frequency; this.outputList = outputList; }
private void drawPiece(QMazePieceType pieceType, string pieceName, Texture2D pieceIcon, bool specOptions = false) { QMazePiece piece = mazePiecePack.getPiece(pieceType); GUILayout.Box(pieceIcon); GUILayout.BeginVertical(); { drawPieceGeometryList(pieceName, piece); bool found = false; bool errorFound = false; for (int i = 0; i < piece.geometryList.Count; i++) { if (piece.geometryList[i] != null) { found = true; } else { errorFound = true; } } if (piece.require && !found) { EditorGUILayout.HelpBox("Piece geometry is required", MessageType.Warning); } else if (errorFound) { EditorGUILayout.HelpBox("One of the elements is null", MessageType.Warning); } if (specOptions) { GUILayout.BeginHorizontal(); { GUILayout.Space(20); GUILayout.Label("Use"); piece.use = EditorGUILayout.Toggle(piece.use, GUILayout.Width(40)); } GUILayout.EndHorizontal(); if (piece.use) { GUILayout.BeginHorizontal(); { GUILayout.Space(20); GUILayout.Label("Frequency", GUILayout.MinWidth(40)); piece.frequency = Mathf.Clamp01(EditorGUILayout.FloatField(piece.frequency, GUILayout.Width(40))); } GUILayout.EndHorizontal(); } } } GUILayout.EndVertical(); }
private void addPiece(QMazePieceType type, bool require, bool use, float frequency, params QMazeOutput[] mazeOutput) { List <QMazeOutput> outputs = new List <QMazeOutput>(); for (int i = 0; i < mazeOutput.Length; i++) { outputs.Add(mazeOutput[i]); } mazePieceArray[(int)type] = new QMazePiece(type, require, use, frequency, outputs); }
private void drawPiece(QMazePieceType pieceType, string pieceName, Texture2D pieceIcon, bool specOptions = false) { QMazePiece piece = mazePiecePack.getPiece(pieceType); GUILayout.Box(pieceIcon); GUILayout.BeginVertical(); { drawPieceGeometryList(pieceName, piece); bool found = false; bool errorFound = false; for (int i = 0; i < piece.geometryList.Count; i++) { if (piece.geometryList[i] != null) { found = true; } else { errorFound = true; } } if (piece.require && !found) EditorGUILayout.HelpBox("Piece geometry is required", MessageType.Warning); else if (errorFound) EditorGUILayout.HelpBox("One of the elements is null", MessageType.Warning); if (specOptions) { GUILayout.BeginHorizontal(); { GUILayout.Space(20); GUILayout.Label("Use"); piece.use = EditorGUILayout.Toggle(piece.use, GUILayout.Width(40)); } GUILayout.EndHorizontal(); if (piece.use) { GUILayout.BeginHorizontal(); { GUILayout.Space(20); GUILayout.Label("Frequency", GUILayout.MinWidth(40)); piece.frequency = Mathf.Clamp01(EditorGUILayout.FloatField(piece.frequency, GUILayout.Width(40))); } GUILayout.EndHorizontal(); } } } GUILayout.EndVertical(); }
private void addPiece(QMazePieceType type, bool require, bool use, float frequency, params QMazeOutput[] mazeOutput) { List<QMazeOutput> outputs = new List<QMazeOutput>(); for (int i = 0; i < mazeOutput.Length; i++) outputs.Add(mazeOutput[i]); mazePieceArray[(int)type] = new QMazePiece(type, require, use, frequency, outputs); }
public QMazePiece getPiece(QMazePieceType type) { return mazePieceArray[(int)type]; }
/// <summary> /// Getting the particular type of piece from this pack /// </summary> /// <returns>The maze piece</returns> /// <param name="type">Type of the maze piece</param> public QMazePiece getPiece(QMazePieceType type) { return(mazePieceArray[(int)type]); }
public QMazePieceData(int x, int y) { this.x = x; this.y = y; type = QMazePieceType.None; }