public void Spawn(Vector3 pos, int level)
    {
        int        fruitLevel  = level;
        GameObject fruitObject = factory.MakeFruit(new FruitStandardModel(fruitLevel));

        fruitObject.transform.position = pos;
        fruitObject.transform.parent   = parentProvider.GetParent();
        if (fruitObject.TryGetComponent(out FruitStandard fruit))
        {
            fruit.AddSpawnReceiver(Spawn);
            fruit.AddScoreReceiver(scoreReceiver);
            fruit.AddAudioReceiver(audioReceiver);
            fruit.AddStateReceiver(stateReceiver);
        }
    }
예제 #2
0
 void Start()
 {
     ParentRow = parentRowProvider.GetParent();
 }