예제 #1
0
        public static BENumber Gold;                                    // total gold number

        void Awake()
        {
            instance = this;
            Gold     = new BENumber(BENumber.IncType.VALUE, "#,##0.00", 0, 10000000000, 2000);         // default user gold id 2000
            //PlayerPrefs.DeleteAll();
            Load();
        }
예제 #2
0
 // when user clicked sfx button
 public void SoundToggled(bool value)
 {
     BEAudioManager.SoundPlay(6);
     //toggle sound value and save
     BESetting.SoundVolume = value ? 0 : 100;
     BESetting.Save();
     //Debug.Log ("SoundVolume:"+BEUtil.instance.SoundVolume.ToString ());
 }
예제 #3
0
        //------------------------------------------
        //callback functions
        // when double game ends
        public void OnDoubleGameEnd(float delta)
        {
            //Debug.Log("OnDoubleGameEnd:"+delta.ToString ());

            //change user gold by delta (change gold value)
            Slot.Gold += delta;
            BESetting.Gold.ChangeTo(Slot.Gold);
            BESetting.Save();
            Slot.gameResult.GameWin += delta;
            Win.ChangeTo(Slot.gameResult.GameWin);
            btnDouble.gameObject.SetActive(false);
        }
예제 #4
0
        public void OnButtonBuy()
        {
            //Debug.Log ("UISGShop::OnButtonBuy");
            BEAudioManager.SoundPlay(0);
            if (Selected == -1)
            {
                return;
            }

            BESetting.Gold.ChangeDelta(ItemList[Selected].total);
            BESetting.Save();
            Hide();
        }
예제 #5
0
        // when spin completed
        public void OnSpinEnd()
        {
            //Debug.Log("OnSpinEnd");

            // if user has win
            if (Slot.gameResult.Wins.Count != 0)
            {
                textInfo.text = "Win " + Slot.gameResult.Wins.Count.ToString() + " Lines ";
            }

            UpdateUI();
            // increase user gold
            BESetting.Gold.ChangeTo(Slot.Gold);
            BESetting.Save();
        }
예제 #6
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
                {
                }
            }
        }
예제 #7
0
        // when use clicked music button
        public void MusicToggled(bool value)
        {
            BEAudioManager.SoundPlay(6);
            // toggle music value and save
            BESetting.MusicVolume = value ? 0 : 100;
            BESetting.Save();

            // play or stop music
            if (value)
            {
                BEAudioManager.instance.MusicStop();
            }
            else
            {
                BEAudioManager.instance.MusicPlay();
            }
        }
예제 #8
0
        public void MusicToggled(bool value)
        {
            //Debug.Log ("MusicToggled "+value);
            BEAudioManager.SoundPlay(0);
            BESetting.MusicVolume = value ? 0 : 100;
            BESetting.Save();

            if (value)
            {
                BEAudioManager.MusicStop();
            }
            else
            {
                if (!BEAudioManager.MusicIsPlaying())
                {
                    BEAudioManager.MusicPlay();
                }
            }
        }
예제 #9
0
 public void SoundToggled(bool value)
 {
     BEAudioManager.SoundPlay(0);
     BESetting.SoundVolume = value ? 0 : 100;
     BESetting.Save();
 }
예제 #10
0
        public static int ShowInstruction = 100;                        // instruction dialog show ? (zero is not show)

        void Awake()
        {
            instance = this;
            Load();
        }