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);
    }
Esempio n. 2
0
 public void Init(CubePickerView view)
 {
     this.view = view;
     this.view.Init(this);
 }