Example #1
0
        private void OnItemCollected(AbstractItem item, Player collectedBy)
        {
            // Check what was collected
            Console.WriteLine("Found item of type:" + item.GetType());
            if (item is GunItem)
            {
                EvolutionManager.Instance.HasGun = true;
                // Update the player
                EvolutionManager.Instance.SetupPlayer(player);
                player.LoadContent();

            }
            else if (item is LegsItem)
            {
                // Set legs to true
                EvolutionManager.Instance.HasLegs = true;
                // Update the player
                EvolutionManager.Instance.SetupPlayer(player);
                player.LoadContent();
            }

            item.OnCollected(collectedBy);
        }