internal virtual void OnObjectDropped(mg_bc_FlyingObject _groundedObject)
 {
     if (_groundedObject is mg_bc_Bag && !Penguin.IsDead && Truck.DeductDropAllowance() > 0)
     {
         OnDropAllowanceExceeded();
     }
 }
Beispiel #2
0
 private void DestroyFlyer(mg_bc_FlyingObject _flyer)
 {
     _flyer.GetLayers(out var _primary, out var _secondary);
     m_availableSpriteLayers.Enqueue(_primary);
     m_availableSpriteLayers.Enqueue(_secondary);
     UnityEngine.Object.Destroy(_flyer.gameObject);
 }
Beispiel #3
0
 protected void UpdateList(List <mg_bc_FlyingObject> _list, float _delta)
 {
     for (int num = _list.Count - 1; num >= 0; num--)
     {
         mg_bc_FlyingObject mg_bc_FlyingObject2 = _list[num];
         mg_bc_FlyingObject2.FlyingUpdate(_delta);
         if (mg_bc_FlyingObject2.State == mg_bc_EObjectState.STATE_TO_DESTROY)
         {
             if (m_isFlyingPowerup && mg_bc_FlyingObject2 is mg_bc_Powerup)
             {
                 m_isFlyingPowerup = false;
             }
             _list.RemoveAt(num);
             DestroyFlyer(mg_bc_FlyingObject2);
         }
         else if (mg_bc_FlyingObject2.State == mg_bc_EObjectState.STATE_FADING_ON_GROUND)
         {
             if (_list != m_groundedObjects)
             {
                 _list.RemoveAt(num);
                 m_groundedObjects.Add(mg_bc_FlyingObject2);
                 OnObjectHitGround(mg_bc_FlyingObject2);
             }
         }
         else if (mg_bc_FlyingObject2.State == mg_bc_EObjectState.STATE_HELD && _list != m_heldObjects)
         {
             _list.RemoveAt(num);
             m_heldObjects.Add(mg_bc_FlyingObject2);
         }
     }
 }
        private void OnTriggerEnter2D(Collider2D _collider)
        {
            mg_bc_FlyingObject component = _collider.gameObject.GetComponent <mg_bc_FlyingObject>();

            if (component != null)
            {
                component.Destroy();
            }
        }
Beispiel #5
0
 private void DestroyObjectsInList(List <mg_bc_FlyingObject> _list)
 {
     for (int num = _list.Count - 1; num >= 0; num--)
     {
         mg_bc_FlyingObject flyer = _list[num];
         _list.RemoveAt(num);
         DestroyFlyer(flyer);
     }
 }
 internal override void OnObjectDropped(mg_bc_FlyingObject _groundedObject)
 {
     base.OnObjectDropped(_groundedObject);
     if (_groundedObject is mg_bc_Bag && !base.Penguin.IsDead)
     {
         if (m_droppedBags % 10 == 0)
         {
             ShowHint("Do not\ndrop bags!", 2f);
         }
         m_droppedBags++;
     }
 }
Beispiel #7
0
        private void Spawn()
        {
            GameObject gameObject = GenerateObjectToSpawn();

            if (gameObject != null)
            {
                mg_bc_FlyingObject component = gameObject.GetComponent <mg_bc_FlyingObject>();
                MinigameSpriteHelper.AssignParentTransform(gameObject, base.transform.parent);
                m_flyingObjects.Add(component);
                gameObject.transform.localPosition = m_spawnLocation;
                component.SetLayers(m_availableSpriteLayers.Dequeue(), m_availableSpriteLayers.Dequeue());
                string text = "mg_bc_sfx_BagThrowWhoosh0" + UnityEngine.Random.Range(1, 4);
                MinigameManager.GetActive().PlaySFX(text);
                m_timeSinceLastSpawn = 0f;
                Rigidbody2D component2 = gameObject.GetComponent <Rigidbody2D>();
                component2.gravityScale = 2f;
                int num = UnityEngine.Random.Range(0, VELOCITIES.Length);
                component2.AddForce(VELOCITIES[num]);
            }
        }
Beispiel #8
0
 private void OnObjectHitGround(mg_bc_FlyingObject _groundedObject)
 {
     MinigameManager.GetActive <mg_BeanCounter>().GameLogic.OnObjectDropped(_groundedObject);
 }