Beispiel #1
0
        public override void Reset()   // this is called 4 times
        {
            _carryingPowerup = new List <Powerup>(); _carryingPowerup.Clear();
            //int boughtPowerup = 0;
            if (BuyPowerupManager.Instance != null && _player != null)
            {
                if (BuyPowerupManager.Instance.HasBoughtPowerup(_player.PlayerIndex))
                {
                    //create and add powerup
                    Powerup newPowerup = Spawner.Instance.SpawnPowerupToBuy();//Powerup.PowerupFromIndex(boughtPowerup);
                    newPowerup.DoPickup(_player);
                    //newPowerup.SetOwner(_player);
                    //_carryingPowerup.Clear();
                    //_carryingPowerup.Add(newPowerup);
                    //Collect(newPowerup); // TODO make sure this works
                }
            }

            PowerupUI.Instance.UpdatePlayerPowerupUI(gameObject.GetComponent <Player>().PlayerIndex, CarryingPowerups());
        }