Beispiel #1
0
        private void UpdateLocationText()
        {
            _locationText.text = "";

            if (ConferenceRoomManager.Instance != null)
            {
                string sceneName = ConferenceRoomManager.Instance.CurrentRoom.SceneName;
                int    floorId   = (int)ConferenceRoomManager.Instance.CurrentRoom.FloorId;

                Tuple <string, int> currentLocation = new Tuple <string, int>(sceneName, floorId);

                List <Tuple <string, int, string> > halls = new List <Tuple <string, int, string> >();

                halls.Add(new Tuple <string, int, string>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.DigitalAutomation), 0, I2.Loc.LocalizationManager.GetTranslation("Map/TopButtons/DigitalAutomationButton")));
                halls.Add(new Tuple <string, int, string>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.Energy), 0, I2.Loc.LocalizationManager.GetTranslation("Map/TopButtons/EnergyButton")));
                halls.Add(new Tuple <string, int, string>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.ExtractionProcessing), 0, I2.Loc.LocalizationManager.GetTranslation("Map/TopButtons/ExtractionProcessingButton")));
                halls.Add(new Tuple <string, int, string>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.Government), 0, I2.Loc.LocalizationManager.GetTranslation("Map/TopButtons/GovernmentButton")));
                halls.Add(new Tuple <string, int, string>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.HSSE), 0, I2.Loc.LocalizationManager.GetTranslation("Map/TopButtons/HSSEButton")));
                halls.Add(new Tuple <string, int, string>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.Partners), 0, I2.Loc.LocalizationManager.GetTranslation("Map/TopButtons/PartnersButton")));
                halls.Add(new Tuple <string, int, string>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.Telecommunication), 0, I2.Loc.LocalizationManager.GetTranslation("Map/TopButtons/TelecommunicationButton")));
                halls.Add(new Tuple <string, int, string>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.TransportationStorage), 0, I2.Loc.LocalizationManager.GetTranslation("Map/TopButtons/TransportationStorageButton")));

                var location = halls.Find(x => (x.Item1 == currentLocation.Item1 && x.Item2 == currentLocation.Item2));
                if (location != null && !string.IsNullOrEmpty(location.Item3))
                {
                    _locationText.text = location.Item3;
                }
            }
        }
Beispiel #2
0
        private void JoinExpo()
        {
            List <Tuple <string, int> > halls = new List <Tuple <string, int> >();

            halls.Add(new Tuple <string, int>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.DigitalAutomation), 0));
            halls.Add(new Tuple <string, int>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.Energy), 0));
            halls.Add(new Tuple <string, int>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.ExtractionProcessing), 0));
            halls.Add(new Tuple <string, int>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.Government), 0));
            halls.Add(new Tuple <string, int>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.HSSE), 0));
            halls.Add(new Tuple <string, int>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.Partners), 0));
            halls.Add(new Tuple <string, int>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.Telecommunication), 0));
            halls.Add(new Tuple <string, int>(ExpoSceneNames.GetNameFromEnum(ExpoSceneNames.MapType.TransportationStorage), 0));

            Tuple <string, int> hall = halls[UnityEngine.Random.Range(1, halls.Count)];

            string newSceneName = hall.Item1;
            int    floorId      = hall.Item2;

            string spawnPoint = "";

            ConferenceRoomManager.LoadRoom(newSceneName, (byte)floorId, spawnPoint, null);
        }