void onPickup(PickUpEvent pickUpEvent) { if (pickUpEvent.pickup.Type == PickUpType.PIZZA) { animator.Play("CollectableFlyIn"); } }
public void PickupEventConstructorTest() { _pe = new PickUpEvent(location, item, actor); Assert.AreEqual(_pe.Location, location); Assert.AreEqual(_pe.Item, item); Assert.AreEqual(_pe.Actor, actor); }
private void OnTriggerEnter(Collider other) { var findingPickUpItem = other.GetComponent <IPickUpItem>(); if (findingPickUpItem != null) { PickUpEvent?.Invoke(findingPickUpItem); } }
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)); } }
void onCollectableGathered(PickUpEvent pickUpEvent) { print("Type: " + pickUpEvent.pickup.Type); if (pickUpEvent.pickup.Type == PickUpType.PIZZA) { collectablesGathered++; slider.SliderValue = collectablesGathered; setText(collectablesGathered); } }
// 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>(); }
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>(); }
public void ActorTest() { _pe = new PickUpEvent(location, item, actor); Assert.AreEqual(_pe.Actor, actor); }