Exemplo n.º 1
0
        public override void OnShowScreen(bool first)
        {
            _started = false;

            MapSelect.ClearOptions();
            MapSelect.AddOptions(UnityDB.AllOf <MapAsset>().Select(x => x.Settings.Scene).ToList());
            MapSelect.value = 0;
        }
Exemplo n.º 2
0
        void CheckForGameStart()
        {
            if (_started)
            {
                return;
            }

            var start = false;
            var map   = default(String);

            if (TryGetRoomProperty <Boolean>("START", out start) && TryGetRoomProperty <String>("MAP", out map))
            {
                if (start && String.IsNullOrEmpty(map) == false)
                {
                    _started = true;

                    RuntimeConfig config;
                    config         = new RuntimeConfig();
                    config.Players = new RuntimePlayer[PhotonNetwork.room.MaxPlayers];

                    for (Int32 i = 0; i < config.Players.Length; ++i)
                    {
                        config.Players[i] = new RuntimePlayer();
                        config.Players[i].CharacterSpec.Guid = "mage";
                    }

                    config.Map.Guid = UnityDB.AllOf <MapAsset>().First(x => x.Settings.Scene == map).Settings.Guid;
                    config.GameMode = Photon.Deterministic.DeterministicGameMode.Multiplayer;

                    QuantumRunner.StartGame(config);

                    UIRoom.HideScreen();
                    UILeaveGame.ShowScreen();
                }
            }
        }