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); } }
void Start() { ParentRow = parentRowProvider.GetParent(); }