private BoxInScript getBox() { int boxType = boxQueue.putBox(); BoxInScript boxInScript = new BoxInScript(); if (boxType == 0x6) { boxInScript.boxObject = GameObject.Instantiate(gameBox1100Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 0.0f); } else if (boxType == 0xA) { boxInScript.boxObject = GameObject.Instantiate(gameBox1100Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 90.0f); } else if (boxType == 0x9) { boxInScript.boxObject = GameObject.Instantiate(gameBox1100Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 180.0f); } else if (boxType == 0x5) { boxInScript.boxObject = GameObject.Instantiate(gameBox1100Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 270.0f); } else if (boxType == 0x7) { boxInScript.boxObject = GameObject.Instantiate(gameBox1110Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 0.0f); } else if (boxType == 0xE) { boxInScript.boxObject = GameObject.Instantiate(gameBox1110Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 90.0f); } else if (boxType == 0xB) { boxInScript.boxObject = GameObject.Instantiate(gameBox1110Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 180.0f); } else if (boxType == 0xD) { boxInScript.boxObject = GameObject.Instantiate(gameBox1110Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 270.0f); } else if (boxType == 0xC) { boxInScript.boxObject = GameObject.Instantiate(gameBox1010Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 0.0f); } else if (boxType == 0x3) { boxInScript.boxObject = GameObject.Instantiate(gameBox1010Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 90.0f); } else if (boxType == 0xF) { boxInScript.boxObject = GameObject.Instantiate(gameBox1111Instance); boxInScript.boxObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 0.0f); } boxInScript.boxData = new Box(boxType); return boxInScript; }
private void tryPushBoxInScript(BoxInScript curBoxInScript, BoxInScript nextBoxInScript, Queue newQueue) { if (nextBoxInScript == null) return; if (nextBoxInScript.bIrrigation) { return; } if ((curBoxInScript.boxData.up && nextBoxInScript.boxData.down) || (curBoxInScript.boxData.down && nextBoxInScript.boxData.up) || (curBoxInScript.boxData.left && nextBoxInScript.boxData.right) || (curBoxInScript.boxData.right && nextBoxInScript.boxData.left)) { newQueue.Enqueue(nextBoxInScript); nextBoxInScript.bIrrigation = true; } }
private void setGrass(bool grassOn, BoxInScript boxInScript) { Transform child = boxInScript.boxObject.transform.GetChild(0); if (grassOn) child.localPosition = new Vector3(0.0f, 0.0f, 0.5f); else child.localPosition = new Vector3(0.0f, 0.0f, 0.0f); }