void onPickup(PickUpEvent pickUpEvent)
 {
     if (pickUpEvent.pickup.Type == PickUpType.PIZZA)
     {
         animator.Play("CollectableFlyIn");
     }
 }
Ejemplo n.º 2
0
 public void PickupEventConstructorTest()
 {
     _pe = new PickUpEvent(location, item, actor);
     Assert.AreEqual(_pe.Location, location);
     Assert.AreEqual(_pe.Item, item);
     Assert.AreEqual(_pe.Actor, actor);
 }
Ejemplo n.º 3
0
    private void OnTriggerEnter(Collider other)
    {
        var findingPickUpItem = other.GetComponent <IPickUpItem>();

        if (findingPickUpItem != null)
        {
            PickUpEvent?.Invoke(findingPickUpItem);
        }
    }
Ejemplo n.º 4
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("PickUp") && canPickUp)
     {
         PickUp    pickUpItem     = other.GetComponent <PickUp>();
         ItemGroup extraItemGroup = null;
         backpack.TryPutIn(pickUpItem.itemGroup, out extraItemGroup);
         PickUpEvent?.Invoke(this, new PickUpEventDate(pickUpItem, attrManager.faction));
     }
 }
Ejemplo n.º 5
0
 void onCollectableGathered(PickUpEvent pickUpEvent)
 {
     print("Type: " + pickUpEvent.pickup.Type);
     if (pickUpEvent.pickup.Type == PickUpType.PIZZA)
     {
         collectablesGathered++;
         slider.SliderValue = collectablesGathered;
         setText(collectablesGathered);
     }
 }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        GameStartEvent.Register(onGameStart);
        PickUpEvent.Register(onCollectableGathered);
        PlayerRespawnEvent.Register(onPlayerRespawn);

        statistics = GameObject.FindGameObjectWithTag("Statistics").GetComponent <Statistics>();

        slider = GetComponentInChildren <CircleSlider>();
        text   = GetComponentInChildren <Text>();
    }
Ejemplo n.º 7
0
        public void ItemTest()
        {
            IList<IItem> items = new List<IItem>();
            items.Add(new Coin());
            var j = new Coin();
              location.AddItem(new Coin());
            var k = new PickUpEvent(location, new Coin(), actor);
            location.OnNext(k);

            Assert.AreEqual(0,location.Items.Count);
        }
 void Awake()
 {
     CheckpointReachedEvent.Register(OnCheckpointPassed);
     EnemyDeathEvent.Register(onEnemyKilled);
     GameOverEvent.Register(onGameOver);
     PickUpEvent.Register(onPickup);
     PlayerDamagedEvent.Register(onPlayerDamaged);
     PlayerDeathEvent.Register(onPlayerDeath);
     GameStartEvent.Register(onGameStart);
     respawnCounter    = Lives;
     RespawnFadeObject = GameObject.Find(RespawnFadeObjectName);
 }
    void onPickup(PickUpEvent pickUpEvent)
    {
        if (pickUpEvent.pickup.Type == PickUpType.AMMO ||
            pickUpEvent.pickup.Type == PickUpType.SHIELD)
        {
            tempStatsData.PowerupsCollected++;
        }

        if (pickUpEvent.pickup.Type == PickUpType.PIZZA)
        {
            tempStatsData.CollectablesGathered++;
        }
    }
 private void Start()
 {
     PickUpEvent.Register(onPickup);
     animator = GetComponent <Animator>();
 }
Ejemplo n.º 11
0
 public void ActorTest()
 {
     _pe = new PickUpEvent(location, item, actor);
     Assert.AreEqual(_pe.Actor, actor);
 }