public void Activate(GameObject piece) { foreach (GameObject spawn in GameObject.FindGameObjectsWithTag("Spawn Box")) { SpawnBox box = spawn.GetComponent <SpawnBox>(); if (box.getLastPieceComponent().player != piece.GetComponent <Piece>().player) { Activation(box.getLastPiece()); } } }
IEnumerator waitforDestory() { Boxes[] boxes = FindObjectsOfType(typeof(Boxes)) as Boxes[]; foreach (Boxes box in boxes) { Destroy(box.gameObject); yield return(new WaitForSeconds(0.2f)); } SpawnBox sb = FindObjectOfType(typeof(SpawnBox)) as SpawnBox; sb.SpawnNewBox(); txtInfo.text = ""; mask.DOFade(0, 0.5f); btnReplay.transform.DOMove(initBtnReplayPos, 0.5f); btnReplay.transform.DOScale(0.3f * Vector3.one, 0.5f); isPause = false; }
// Use this for initialization void Start() { player = GameObject.FindWithTag("Player").transform; spawnBox = GameObject.Find("CreateBlockPoint").GetComponent <SpawnBox>(); }
public void setSpawner(SpawnBox spawner) { this.spawner = spawner; }