// Start is called before the first frame update void Start() { scale = transform.localScale.x / 2; current = "down"; script1 = (CreateFace)face1.GetComponent(typeof(CreateFace)); script2 = (CreateFace)face2.GetComponent(typeof(CreateFace)); script3 = (CreateFace)face3.GetComponent(typeof(CreateFace)); script4 = (CreateFace)face4.GetComponent(typeof(CreateFace)); script5 = (CreateFace)face5.GetComponent(typeof(CreateFace)); script6 = (CreateFace)face6.GetComponent(typeof(CreateFace)); scriptI = (IdentifyTile)coordinate.GetComponent(typeof(IdentifyTile)); scriptC = (CameraScript)cameraobject.GetComponent(typeof(CameraScript)); newsquare = false; }
void OnTriggerEnter(Collider other) { if (!connected & !shift) { if (other.CompareTag("Face")) { //Debug.Log("whoo"); script1 = (CreateFace)other.GetComponentInParent(typeof(CreateFace)); if (script1 != null) { //Debug.Log(script1.AskColor()); if (script1.AskColor() != "travel") { connected = true; shift = true; shiftto = script1.AskColor(); } } } } }
static void Main(string[] args) { Console.WriteLine(CreateFace.CreateF()); Console.ReadKey(); }
private void FillWithQuads(byte[][] mask, int currentSlice, ref ChunkStruct c, CreateFace createFace) { for (int x = 0; x < mask.Length; x++) { byte[] row = mask[x]; for (int y = 0; y < row.Length; y++) { if (row[y] != (byte)VoxelTypes.Air) { byte currentId = row[y]; int startX = x; int startY = y; int endY = findYEnd(row, currentId, startY); int endX = findXEnd(mask, currentId, startY, endY, x); y = endY - 1; //public delegate void CreateFace(ref ChunkStruct c, int x, int y, int z, int x2, int y2, int z2); createFace(ref c, startX, startY, endX, endY, currentSlice); } } } }