Esempio n. 1
0
        public void RemoveBills()
        {
            int   replenishQuantity = 0;
            Money money             = null;

            List <decimal> denominations = new List <decimal>(validFeedDenominations);

            denominations.Sort();
            denominations.Reverse();
            foreach (decimal denomination in denominations)
            {
                if (currencyDenominations.ContainsKey(denomination))
                {
                    money = currencyDenominations[denomination];
                    money.SetQuantity(replenishQuantity);
                }
                else
                {
                    switch (denomination)
                    {
                    case 100M:
                        money = new HundredDollar(false, replenishQuantity);
                        break;

                    case 50M:
                        money = new FiftyDollar(false, replenishQuantity);
                        break;

                    case 20M:
                        money = new TwentyDollar(false, replenishQuantity);
                        break;

                    case 10M:
                        money = new TenDollar(false, replenishQuantity);
                        break;

                    case 5M:
                        money = new FiveDollar(false, replenishQuantity);
                        break;

                    case 2M:
                        money = new TwoDollar(false, replenishQuantity);
                        break;

                    case 1M:
                        money = new OneDollar(false, replenishQuantity);
                        break;
                    }
                    if (money != null)
                    {
                        currencyDenominations.Add(denomination, money);
                    }
                }
            }
        }
Esempio n. 2
0
 void Drawing()
 {
     if (Input.GetKeyDown(KeyCode.Mouse0))
     {
         CreateBrush();
     }
     else if (Input.GetKey(KeyCode.Mouse0))
     {
         PointToMousePos();
     }
     else if (Input.GetKeyUp(KeyCode.Mouse0) && hasDrawn)
     {
         if (currentLineRenderer != null)
         {
             currentLineRenderer.positionCount = 0;
         }
         if (pointsList.Count >= 2)
         {
             int i = 0;
             for (; i < 4; i++)
             {
                 if (_storeString[i][0] != "0")
                 {
                     bool result1 = OneDollar.Result(pointsList, _storeString[i][0], 0.35f);
                     bool result2 = OneDollar.Result(pointsList, _storeString[i][1], 0.35f);
                     if (result1 || result2)
                     {
                         punchAnim.SetTrigger("Soco");
                         audioManager.Play("DrawCompleted");
                         eraseDrawing(i);
                         if (aux.Count == 4)
                         {
                             point++;
                             pointsText.text = point.ToString();
                             StopAllCoroutines();
                             sortMany();
                             StartCoroutine(sortThenErase(resetDrawsTime));
                         }
                         break;
                     }
                 }
             }
         }
         currentLineRenderer = null;
         pointsList.Clear();
     }
     else
     {
         currentLineRenderer = null;
     }
 }