public IEnumerator CollectMoney(MoneyCollectionLocation.MoneyCollection collection)
        {
            if (CurrentState == MoneyState.Available)
            {
                PrepareForDisposal(MoneyState.Collected);

                AssignPhysicMaterial(null);

                Vector3 pushVector = (collection.collectionFloor.transform.position - transform.position).normalized * minorBounceForce;
                //Debug.DrawLine(transform.position, transform.position + pushVector, Color.green, 5.0f);
                PushMoney(pushVector);
                pushTarget = collection.collectionFloor;

                //Debug.Log("$" + MonetaryValue + " Money was collected\n");
                HeistManager.Inst.ScoreDisplay.AddMoney(MonetaryValue);

                //Play collection visuals/audio
                CollectionVisuals(collection);
                CollectionAudio();

                myRB.drag  = 0;
                myRB.mass *= 3;

                yield return(new WaitForSeconds(2.5f));

                HandleCollection(collection);

                yield return(null);
            }
        }
        public GameObject CollectionVisuals(MoneyCollectionLocation.MoneyCollection collection)
        {
            GameObject newVisual = HeistManager.Inst.CreateCollectionVisual(MonetaryValue);

            newVisual.transform.position = collection.collisionLocation;
            newVisual.transform.SetParent(collection.collectionBin);
            newVisual.transform.LookAt(newVisual.transform.position);

            Destroy(newVisual, 5.0f);

            return(newVisual);
        }
 protected virtual void HandleCollection(MoneyCollectionLocation.MoneyCollection collection)
 {
     if (collection.collectionBin != null && collection.collectionBin.parent != null)
     {
         transform.SetParent(collection.collectionBin.parent);
         MyRB.isKinematic = true;
     }
     else
     {
         DisableVisuals();
         DisableCollision();
     }
 }
 protected override void OnTriggerEnter(Collider col)
 {
     //We only check for Ignore Raycast (as that is where the HandObject is located)
     if (col.gameObject.layer == 2)
     {
         HandObject hand = col.GetComponent <HandObject>();
         if (hand != null)
         {
             MoneyCollectionLocation.MoneyCollection collection = new MoneyCollectionLocation.MoneyCollection();
             collection.moneyCollide    = col;
             collection.dirToOutOfBin   = Vector3.up;
             collection.collectionFloor = col.transform;
             StartCoroutine(CollectMoney(collection));
             Destroy(gameObject, 5);
         }
     }
     base.OnTriggerEnter(col);
 }
        //Override our grab functionality to immediately collect.

        protected override void HandleCollection(MoneyCollectionLocation.MoneyCollection collection)
        {
            DisableVisuals();
            DisableCollision();
        }