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

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

            _ui      = slotUI;
            _machine = _ui.SlotMachine;
        }
Exemple #2
0
        void Start()
        {
            _slotConfig = FindObjectOfType <SlotConfig>();
            if (_slotConfig == null)
            {
                throw new NullReferenceException("SlotConfig can not be null!");
            }

            MachineConfig = _slotConfig.MainMachine;

            _model = SlotModel.Instance;
            _model.Initialize(_slotConfig, this);
            _betting = _model.Betting;

            if (_slotConfig.DebugTestSpin)
            {
                gameObject.AddComponent <DebugHelper>();
            }

            GamePool.SymbolLoad(_slotConfig);

            SetState(MachineState.Connecting);
        }
Exemple #3
0
        static public void SymbolLoad(SlotConfig config)
        {
            PoolMasterEvents.onPreloadPool += OnPreloadPool;

            //CreatePools
            var symbolPool  = new Pool(POOL_SYMBOL);
            var machineList = config.MachineList;

            for (var i = 0; i < machineList.Count; ++i)
            {
                var machine = machineList[i];
                var list    = machine.SymbolDefineList;
                for (var j = 0; j < list.Count; ++j)
                {
                    var symbolDefine = list[j];
                    symbolPool.uniquePool.Add(symbolDefine.prefab.gameObject);
                    symbolPool.bufferAmount.Add(symbolDefine.buffer);
                }
            }
            _pool.pools.Add(symbolPool);

            //load
            _pool.Preload(POOL_SYMBOL);
        }
Exemple #4
0
 public void Initialize(SlotConfig config, SlotMachine startMachine)
 {
     SlotConfig = config;
     SetMachine(startMachine);
 }
Exemple #5
0
 public MachineConfig(SlotConfig relativeSlotConfig)
 {
     RelativeSlotConfig = relativeSlotConfig;
 }
Exemple #6
0
 virtual public void SettingByScript()
 {
     _slotConfig  = GetComponent <SlotConfig>();
     _soundPlayer = GetComponent <SlotSoundList>();
 }