Esempio n. 1
0
        private void CreatePowerUp(int x, int y)
        {
            float     random = Random.value;
            Transform powerupTransform;

            if (random < addPowerupProbability)
            {
                AddCoin addCoin = Instantiate(addCoinPrefab);
                addCoin.OnCollision += AddCoinCollision;
                powerupTransform     = addCoin.transform;

                powerupTransform.SetParent(gridContainer);
                powerupTransform.localPosition = GetPositionFromModel(x, y);
                powerupTransform.localScale   *= stepX;
                shapes.Add(powerupTransform);
            }
        }
Esempio n. 2
0
 private void AddCoinCollision(AddCoin collision)
 {
     shapes.Remove(collision.transform);
     ScoresAndCoins.SCM.AddCoins();
 }