Example #1
0
        override public void Init(SlotMachineUI slotUI)
        {
            base.Init(slotUI);
            content.interactable   = false;
            content.blocksRaycasts = false;
            _contentRtf            = content.gameObject.GetComponent <RectTransform>();

            Reset();
        }
        virtual public void Init(SlotMachineUI slotUI)
        {
            _model = SlotModel.Instance;

            _slotConfig = _model.SlotConfig;
            _betting    = _slotConfig.Betting;

            _ui      = slotUI;
            _machine = _ui.SlotMachine;
        }
Example #3
0
        override public void Init(SlotMachineUI slotUI)
        {
            base.Init(slotUI);

            _betting.OnUpdateLineBetIndex += OnUpdateLineBetHandler;

            SetLineNum(_slotConfig.MainMachine.paylineTable.Count);

            SetWin(0);

            OnUpdateLineBetHandler();
        }
Example #4
0
        IEnumerator Initialize(ResDTO.Login dto)
        {
            //필요한 리소스 Pool 들의 preload 가 완료 되길 기다린다.
            while (GamePool.IsReady == false)
            {
                Debug.Log("Wait Pool...");
                yield return(new WaitForSeconds(0.2f));
            }

            Debug.Log("Pool readied");

            _model.SetLoginData(dto);

            //-----------------------------------------------------------------
            // essential module
            // ReelContainer & Topboard & SlotMachineUI
            //-----------------------------------------------------------------

            _ui = FindObjectOfType <SlotMachineUI>() as SlotMachineUI;
            _ui.Initialize(this);

            _reelContainer = GetComponentInChildren <ReelContainer>();
            _reelContainer.Initialize(this);
            _reelContainer.OnPlayAllWin       += OnPlayAllWinHandler;
            _reelContainer.OnPlayEachWin      += OnPlayEachWinHandler;
            _reelContainer.OnReelStopComplete += OnReelStopCompleteListener;

            _topboard = GetComponentInChildren <Topboard>();

            _paylineDisplayer = GetComponentInChildren <PaylineDisplayer>();
            if (_paylineDisplayer != null)
            {
                _paylineDisplayer.Initialize(this);
            }

            _freeSpinDirector = GetComponentInChildren <FreeSpinDirector>();
            if (_freeSpinDirector != null)
            {
                _freeSpinDirector.Initialize(this);
            }

            SlotSoundList.Initialize();

            GameManager.Instance.SceneReady();

            SetState(MachineState.Idle);
        }
Example #5
0
        override public void Init(SlotMachineUI slotUI)
        {
            base.Init(slotUI);

            _model.OnUpdateAutoSpinCount += (count) =>
            {
                UpdateAutoButton(_model.IsAutoSpin);
            };

            _betting.OnUpdateLineBetIndex += () =>
            {
                UpdateButtonState();
            };


            btnPaytable.onClick.AddListener(() =>
            {
                _ui.OpenPaytable();
            });

            btnSpin.onClick.AddListener(() =>
            {
                _ui.SlotMachine.TrySpin();
            });

            if (btnStop != null)
            {
                btnStop.onClick.AddListener(() =>
                {
                    _ui.SlotMachine.TrySpin();
                });
            }

            btnBetDecrease.onClick.AddListener(() =>
            {
                _betting.Decrease();
            });

            btnBetIncrease.onClick.AddListener(() =>
            {
                _betting.Increase();
            });

            btnFast.onValueChanged.AddListener((b) =>
            {
                _model.IsFastSpin = b;
            });

            btnAuto.onValueChanged.AddListener((b) =>
            {
                if (b)
                {
                    _model.StartAutoSpin();
                }
                else
                {
                    _model.StopAutoSpin();
                }
            });

            UpdateButtonState();
        }
Example #6
0
        override public void Init(SlotMachineUI slotUI)
        {
            base.Init(slotUI);

            WriteBoard(GAME_INIT);
        }