// Use this for initialization void Start() { // spawner(); storedShapes = new List <GameObject>(); spawnOne(); tL = GameObject.FindGameObjectWithTag("tetrisObj").GetComponent <tetrisLogic>(); GameObject gm = GameObject.Find("GameManager"); gameOverMain = gm.GetComponent <TetrisManager>(); }
public void spawner() { Vector3 pos = center + new Vector3(Random.Range(-size.x / 2, size.x / 2), Random.Range(-size.y / 2, size.y / 2) , Random.Range(-size.z / 2, size.z / 2)); int i = Random.Range(0, shapes.Length); if (tL.isMoving == false) { //Debug.Log("hit"); GameObject newShape = (GameObject)Instantiate(shapes[i], pos, Quaternion.Euler(-128.248f, 0f, 0f)); newShape.name = shapes[i].name; //Debug.Log(newShape.name); newShape.transform.parent = spwnd_shapes.transform; storedShapes.Add(newShape); tL = null; tL = storedShapes[storedShapes.Count - 1].GetComponent <tetrisLogic>(); shapeCount++; } }
// Use this for initialization void Start() { createShadow(); tL = gameObject.GetComponentInParent <tetrisLogic>(); }