Exemplo n.º 1
0
        void OnTriggerEnter(Collider col)
        {
            //Don't do a getcomponent if it isn't on our layer.
            if (col.gameObject.layer == 8)
            {
                MoneyProjectile money = col.GetComponent <MoneyProjectile>();
                if (money != null && CanWeCollectThisMoney(money))
                {
                    MoneyCollection collection = new MoneyCollection();
                    collection.collisionLocation = MyCollider.ClosestPoint(col.transform.position);
                    collection.moneyCollide      = col;
                    collection.collectionBin     = transform;
                    collection.collectionFloor   = Floor.transform;
                    collection.dirToOutOfBin     = OutDirection;

                    CollectMoney(money, collection);
                }
            }
        }
Exemplo n.º 2
0
 public void CollectMoney(MoneyProjectile money, MoneyCollection OutDirection)
 {
     money.StartCoroutine(money.CollectMoney(OutDirection));
 }
Exemplo n.º 3
0
 public bool CanWeCollectThisMoney(MoneyProjectile money)
 {
     return(money.CurrentState == MoneyProjectile.MoneyState.Available);
 }