Ejemplo n.º 1
0
 void Awake()
 {
     giftToPlayer             = GetComponentInChildren <CollectibleDef>(true);
     animManager              = GetComponent <HippieAnimationManager>();
     physic                   = GetComponent <SlugPhysics>();
     HippiesBrain             = HippieTiedUp;
     hippieSpeedWalkingFactor = 0.25f;
     hippieSpeedRunningFactor = 2;
 }
Ejemplo n.º 2
0
 public void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "Collectible")
     {
         CollectibleDef item = col.GetComponent <CollectibleDef>();
         if (item != null)
         {
             PickUpItem(item);
         }
     }
 }
Ejemplo n.º 3
0
 private void PickUpItem(CollectibleDef item)
 {
     if (item.attackID > 0)
     {
         EventManager.TriggerEvent(GlobalEvents.ItemPickedUp);
         attackManager.SetAttack(item.attackID, item.animController);
         attackManager.UpdateBulletCount(item.bulletCount);
     }
     flashBlue.FlashForXSecs(0.18f);
     audioManager.PlaySoundByClip(item.weaponNameAudio);
 }
Ejemplo n.º 4
0
 void Awake()
 {
     animator              = GetComponent <Animator>();
     timeUtils             = GetComponent <TimeUtils>();
     flashRed              = GetComponent <FlashUsingMaterial>();
     colliderWhenIntact    = GetComponent <Collider2D>();
     colliderWhenDestroyed = GetComponent <EdgeCollider2D>();
     collectible           = GetComponentInChildren <CollectibleDef>(true);
     healthManager         = GetComponent <HealthManager>();
     berserkerPool         = GetComponentInChildren <ObjectPoolScript>();
     berserkersOnTheRoof   = new Berserker[3];
 }