void Awake() { State = new Stack <MachineState>(); CacheStateBehaviour(); GameServerCommunicator.Instance.OnConnect += OnConnectListener; GameServerCommunicator.Instance.OnLogin += OnLoginListener; GameServerCommunicator.Instance.OnSpin += OnSpinListener; GamePool.SetParent(transform.parent); }
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); }
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); }
public void Clear() { SetState(SymbolState.Null); GamePool.DespawnSymbol(this); }