Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     // if user press 'escape' key, show quit message window
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         UISGMessage.Show("Quit", "Do you want to quit this program ?", MsgType.OkCancel, MessageQuitResult);
     }
 }
Exemple #2
0
        // user clicked spin button
        public void OnButtonSpin()
        {
            //Debug.Log ("OnButtonSpin");

            BEAudioManager.SoundPlay(0);

            // start spin
            SlotReturnCode code = Slot.Spin();

            // if spin succeed
            if (SlotReturnCode.Success == code)
            {
                // disabled inputs
                ButtonEnable(false);
                btnDouble.gameObject.SetActive(false);
                UpdateUI();
                // apply decreased user gold
                BESetting.Gold.ChangeTo(Slot.Gold);
                BESetting.Save();

                // set info text
                if (Slot.gameResult.InFreeSpin())
                {
                    textInfo.text = "Free Spin " + Slot.gameResult.FreeSpinCount.ToString() + " of " + Slot.gameResult.FreeSpinTotalCount.ToString();
                }
                else
                {
                    textInfo.text = "";
                }
            }
            else
            {
                // if spin fails
                // show Error Message
                if (SlotReturnCode.InSpin == code)
                {
                    UISGMessage.Show("Error", "Slot is in spin now.", MsgType.Ok, null);
                }
                else if (SlotReturnCode.NoGold == code)
                {
                    UISGMessage.Show("Error", "Not enough gold.", MsgType.Ok, null);
                }
                else
                {
                }
            }
        }
Exemple #3
0
        void Update()
        {
            // if user press 'escape' key, show quit message window
            if ((uiState == 0) && Input.GetKeyDown(KeyCode.Escape))
            {
                UISGMessage.Show("Quit", "Do you want to quit this program ?", MsgType.OkCancel, MessageQuitResult);
            }

            Win.Update();

            // if auto spin is on or user has free spin to run, then start spin
            if ((toggleAutoSpin.isOn || Slot.gameResult.InFreeSpin()) && Slot.Spinable())
            {
                //Debug.Log ("Update Spin");
                OnButtonSpin();
            }
        }
Exemple #4
0
 void Start()
 {
     instance = this;
     gameObject.SetActive(false);
     ButtonCallback = new IntEvent();
 }