Beispiel #1
0
        protected override void Awake()
        {
            base.Awake();

            _poolManager = FindObjectOfType <PoolManager>();
            _wssManager  = FindObjectOfType <WebSocketServerManager>();
            _gameManager = FindObjectOfType <GameManager>();

            _wssManager.OnPlayerConnect    += OnPlayerConnect;
            _wssManager.OnPlayerDisconnect += OnPlayerDisconnect;
            _wssManager.OnMessageReceive   += OnMessageReceive;
            _gameManager.OnUserAdd         += OnUserAdd;
            _gameManager.OnUserRemove      += OnUserRemove;

            _messageFactorySystem = FindObjectOfType <MessageFactorySystem>();
            _uiSystem             = FindObjectOfType <UISystem>();

            _messageFactorySystem.OnChangeAvatarMessage += OnChangeAvatarMessage;
            _messageFactorySystem.OnChangeStateMessage  += OnChangeStateMessage;
            _uiSystem.OnCountingFinish += OnCountingFinish;
        }
Beispiel #2
0
        protected override void Awake()
        {
            base.Awake();

            _wssManager  = FindObjectOfType <WebSocketServerManager>();
            _gameManager = FindObjectOfType <GameManager>();
            _wssManager.OnPlayerConnect    += OnPlayerConnect;
            _wssManager.OnPlayerDisconnect += OnPlayerDisconnect;
            _wssManager.OnMessageReceive   += OnMessageReceive;

            _messageFactorySystem = FindObjectOfType <MessageFactorySystem>();

            _messageFactorySystem.OnSwipeMessage += OnSwipeMessage;

            _playersByUser = new Dictionary <UserModel, Player>();
            foreach (var user in _gameManager.Users)
            {
                if (user != null)
                {
                    _playersByUser.Add(user, _boat.AddPlayer(user.AvatarId));
                }
            }
        }