public void SetCubePicker(CubePickerController cpc) { foreach (FallingBlock obj in objects) { obj.SetCubePicker(cpc); } }
private void GameSetUp() { cubePicker = Instantiate(cubePicker, transform.position, Quaternion.identity); cpc = cubePicker.GetComponent <CubePickerController>(); cpv = GameObject.FindGameObjectWithTag("CubePickerView").GetComponent <CubePickerView>(); cpc.Init(cpv); cpc.OnGameWon += GameWon; GameObject leftSpawn = Instantiate(fallingBlockSpawner, left, Quaternion.identity); leftSpawn.GetComponent <FallingBlockSpawner>().SetCubePicker(cpc); GameObject midSpawn = Instantiate(fallingBlockSpawner, mid, Quaternion.identity); midSpawn.GetComponent <FallingBlockSpawner>().SetCubePicker(cpc); GameObject rightSpawn = Instantiate(fallingBlockSpawner, right, Quaternion.identity); rightSpawn.GetComponent <FallingBlockSpawner>().SetCubePicker(cpc); }
public void SetCubePicker(CubePickerController cubePickerController) { this.cubePickerController = cubePickerController; }
public void Init(CubePickerController controller) { this.controller = controller; }