Esempio n. 1
0
        void Awake()
        {
            State = new Stack <MachineState>();
            CacheStateBehaviour();

            GameServerCommunicator.Instance.OnConnect += OnConnectListener;
            GameServerCommunicator.Instance.OnLogin   += OnLoginListener;
            GameServerCommunicator.Instance.OnSpin    += OnSpinListener;

            GamePool.SetParent(transform.parent);
        }
Esempio n. 2
0
        protected Symbol CreateSymbol(string symbolName)
        {
            Symbol symbol = GamePool.SpawnSymbol(symbolName);

            if (symbol == null)
            {
                throw new System.NullReferenceException("Symbol '" + symbolName + "' is null");
            }

            if (symbol.IsInitialized == false)
            {
                symbol.Initialize(symbolName, _machineConfig);
            }

            return(symbol);
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
 public void Clear()
 {
     SetState(SymbolState.Null);
     GamePool.DespawnSymbol(this);
 }