Exemplo n.º 1
0
 public void OnMouseDown(ButtonScript.ButtonType type, SpriteRenderer sr = null)
 {
     if (type == ButtonScript.ButtonType.Spin)
     {
         pushAutoTimer = 0f;
         pushAuto      = false;
         //sr.flipX = false;
         sr.sprite = SpinButtonSprite[slotType - 1];
     }
 }
Exemplo n.º 2
0
 public void OnMouseDrag(ButtonScript.ButtonType type, SpriteRenderer sr = null)
 {
     if (type == ButtonScript.ButtonType.Spin)
     {
         pushAutoTimer += Time.deltaTime;
         if (pushAutoTimer >= 1.5f && !pushAuto)
         {
             pushAuto = true;
             //sr.flipX = true;
             sr.sprite = StopButtonSprite[slotType - 1];
         }
     }
 }
Exemplo n.º 3
0
 public void OnMouseUp(ButtonScript.ButtonType type, SpriteRenderer sr = null)
 {
     if (type == ButtonScript.ButtonType.Spin)
     {
         if (money >= bet)
         {
             if (pushOk)
             {
                 pushOk = false;
                 StartSpin();
             }
         }
         else
         {
             ToMessageManager(gameObject, "Uang tak cukup", ButtonMode.OK, -1);
             pushAuto = false;
         }
     }
     else if (type == ButtonScript.ButtonType.Stop)
     {
         //StartCoroutine(StopSpin());
     }
     else if (type == ButtonScript.ButtonType.Max)
     {
         bet             = betArray[betArray.Length - 1];
         betLabelTM.text = bet.ToString("N0") + ".000";
     }
     else if (type == ButtonScript.ButtonType.Up)
     {
         int betIndex = 0;
         for (int i = 0; i < betArray.Length; i++)
         {
             if (bet == betArray[i])
             {
                 betIndex = i;
                 break;
             }
         }
         if (betIndex + 1 < betArray.Length)
         {
             bet = betArray[betIndex + 1];
         }
         betLabelTM.text = bet.ToString("N0") + ".000";
     }
     else if (type == ButtonScript.ButtonType.Down)
     {
         int betIndex = 0;
         for (int i = 0; i < betArray.Length; i++)
         {
             if (bet == betArray[i])
             {
                 betIndex = i;
                 break;
             }
         }
         if (betIndex - 1 >= 0)
         {
             bet = betArray[betIndex - 1];
         }
         betLabelTM.text = bet.ToString("N0") + ".000";
     }
     else if (type == ButtonScript.ButtonType.Back)
     {
         PlayerData.owned_coin = System.Convert.ToInt32(money);
         _SceneManager.instance.SetActiveScene(SceneType.HOME, true);
         _SceneManager.instance.SetActiveScene(SceneType.SLOTO, false);
     }
     else if (type == ButtonScript.ButtonType.Plus)
     {
         _SceneManager.instance.SetActiveScene(SceneType.SHOP, true);
     }
     else if (type == ButtonScript.ButtonType.Help)
     {
         helpBG.gameObject.SetActive(true);
         helpFG.sprite = helpFGSprite[slotType - 1];
     }
     else if (type == ButtonScript.ButtonType.Minimize)
     {
         helpBG.gameObject.SetActive(false);
     }
 }