Ejemplo n.º 1
0
 protected override void OnInitialize()
 {
     GameObjectUtilities.FindGameObject(_panelRoute + "/AnswerButton").GetComponent <Button>().onClick.AddListener(() => AnswerClickedEvent?.Invoke());
     _panel      = GameObjectUtilities.FindGameObject(_panelRoute);
     _background = GameObjectUtilities.FindGameObject("BackgroundContainer/CallBackgroundImage");
     _callAnim   = GameObjectUtilities.FindGameObject(_panelRoute + "/SatelliteAnimContainer").GetComponent <CallAnimationBehaviour>();
 }
Ejemplo n.º 2
0
        public void OnPointerClick(PointerEventData eventData)
        {
            var description = !string.Equals(_containerImage.sprite.name, UIConstants.ItemContainerDefaultSpriteName, StringComparison.CurrentCultureIgnoreCase) ? _containerImage.sprite.name.ToUpperInvariant() + "_DESCRIPTION" : string.Empty;

            GameObjectUtilities.FindGameObject("Game/Canvas/ItemPanel/ItemContainer_Inventory").GetComponent <ItemContainerBehaviour>().TryGetItem(out var inventory);
            if (_moveItem)
            {
                if (inventory && inventory.Id == _moveItem.Id)
                {
                    if (_moveItemContainer != null)
                    {
                        if (TryGetItem(out var containerItem) == false)
                        {
                            PlayerCommands.DropItem(_moveItem.Id, ContainerIndex);
                        }
                        else
                        {
                            PlayerCommands.SwapInventoryItem(containerItem.Id, ContainerIndex, _moveItem.Id);
                        }
                    }
                    else
                    {
                        if (TryGetItem(out var containerItem) == false)
                        {
                            PlayerCommands.DropAndActivateItem(_moveItem.Id, ContainerIndex);
                        }
                        else
                        {
                            PlayerCommands.SwapAndActivateInventoryItem(containerItem.Id, ContainerIndex, _moveItem.Id);
                        }
                    }
Ejemplo n.º 3
0
 protected override void OnInitialize()
 {
     _panel      = GameObjectUtilities.FindGameObject(_panelRoute);
     _background = GameObjectUtilities.FindGameObject("BackgroundContainer/CallBackgroundImage");
     _scorePanel = GameObjectUtilities.FindGameObject(_panelRoute + "/ScorePanel").GetComponent <ScorePanelBehaviour>();
     GameObjectUtilities.FindGameObject(_panelRoute + "/ScorePanel/NextButton").GetComponent <Button>().onClick.AddListener(OnNextButtonClicked);
 }
Ejemplo n.º 4
0
    protected override void OnInitialize()
    {
        GameObjectUtilities.FindGameObject(_panelRoute + "/MenuPanel/SettingsButton").GetComponent <Button>().onClick.AddListener(() => SettingsClickedEvent?.Invoke());
        GameObjectUtilities.FindGameObject(_panelRoute + "/MenuPanel/LeaderboardButton").GetComponent <Button>().onClick.AddListener(() =>
        {
            SUGARManager.Leaderboard.Display("smi_stars", LeaderboardFilterType.Near);
            SendTrackerEvent("ViewLeaderboard");
        });
        GameObjectUtilities.FindGameObject(_panelRoute + "/MenuPanel/AchievementButton").GetComponent <Button>().onClick.AddListener(() =>
        {
            SUGARManager.Evaluation.DisplayAchievementList();
            SendTrackerEvent("ViewAchievements");
        });
        _panel        = GameObjectUtilities.FindGameObject(_panelRoute);
        _background   = GameObjectUtilities.FindGameObject("BackgroundContainer/MenuBackgroundImage");
        _playButton   = GameObjectUtilities.FindGameObject(_panelRoute + "/MenuPanel/PlayButton").GetComponent <Button>();
        _menuPanel    = GameObjectUtilities.FindGameObject(_panelRoute + "/MenuPanel");
        _quitPanel    = GameObjectUtilities.FindGameObject(_panelRoute + "/QuitPanel");
        _messagePanel = GameObjectUtilities.FindGameObject(_panelRoute + "/MessagePanel");

        _messagePanel.SetActive(false);
        _playButton.onClick.AddListener(() => PlayClickedEvent?.Invoke());
        _quitPanel.transform.FindButton("YesButton").onClick.AddListener(Application.Quit);
        _quitPanel.transform.FindButton("NoButton").onClick.AddListener(() => OnQuitAttempt(true));
    }
Ejemplo n.º 5
0
    public ModulesController()
    {
        var aotFaqList    = new List <FaqEntry>();
        var aotModEntList = new List <ModuleEntry>();

        Localization.Initialize();

        _modulesPopup   = GameObjectUtilities.FindGameObject("GameContainer/GamePanelContainer/ModulesContainer/ModulesPopup");
        _modulesContent = GameObjectUtilities.FindGameObject("GameContainer/GamePanelContainer/ModulesContainer/ModulesPopup/Scroll View").GetComponent <ScrollRect>().content;

        _moduleItemPrefab            = Resources.Load <GameObject>("Prefabs/ModuleItem");
        _moduleIndexItemPrefab       = Resources.Load <GameObject>("Prefabs/ModuleIndexItem");
        _moduleDescriptionItemPrefab = Resources.Load <GameObject>("Prefabs/ModuleDescriptionItem");
        _moduleIcons = Resources.LoadAll <Sprite>("Sprites/Modules/Icons");

        _backButton = GameObjectUtilities.FindGameObject("GameContainer/GamePanelContainer/ModulesContainer/ModulesPopup/BackButton").GetComponent <Button>();
        _nextArrow  = GameObjectUtilities.FindGameObject("GameContainer/GamePanelContainer/ModulesContainer/ModulesPopup/NextArrow").GetComponent <Button>();
        _backArrow  = GameObjectUtilities.FindGameObject("GameContainer/GamePanelContainer/ModulesContainer/ModulesPopup/BackArrow").GetComponent <Button>();

        GameObjectUtilities.FindGameObject("GameContainer/GamePanelContainer/ModulesContainer").GetComponent <Button>().onClick.AddListener(() =>
        {
            TogglePopup();
            SendTrackerEvents("ClosedModuleMenu", "ClosedModuleMenu");
        });

        foreach (var lang in Localization.Languages)
        {
            var www = new WWW((Application.platform != RuntimePlatform.Android ? "file:///" : string.Empty) + Path.Combine(Application.streamingAssetsPath, "modules-" + lang.Name + ".json"));
            while (!www.isDone)
            {
            }
            _modulesDatabase.Add(lang.Name, JsonConvert.DeserializeObject <ModuleEntry[]>(www.text));
        }
        TrackerEventSender.SetModuleDatabase(_modulesDatabase[Localization.SelectedLanguage.Name]);
    }
Ejemplo n.º 6
0
        protected override void OnInitialize()
        {
            var chatPanel = GameObjectUtilities.FindGameObject("Voice/VoicePanelContainer").gameObject;

            _talkButton = GameObjectUtilities.FindGameObject("Voice/PressToTalkButtonContainer").GetComponent <PressedState>();

            base.OnInitialize();
        }
Ejemplo n.º 7
0
 protected override void OnInitialize()
 {
     _panel      = GameObjectUtilities.FindGameObject(_panelRoute);
     _background = GameObjectUtilities.FindGameObject("BackgroundContainer/MenuBackgroundImage");
     _itemPrefab = Resources.Load <GameObject>("Prefabs/LevelItem");
     _gridLayout = GameObjectUtilities.FindGameObject(_panelRoute + "/LevelPanel/Scroll View/Viewport/Content/GridLayout").GetComponent <GridLayoutGroup>();
     GameObjectUtilities.FindGameObject(_panelRoute + "/BackButton").GetComponent <Button>().onClick.AddListener(OnBackClick);
 }
 protected override void OnInitialize()
 {
     _panel                  = GameObjectUtilities.FindGameObject("Menu/SimulationSummaryContainer/SimulationSummaryPanelContainer");
     _columnContainer        = _panel.transform.Find("ColumnContainer");
     _playerMetricsContainer = _panel.transform.Find("PlayerMetricsPanel");
     _continueButton         = _panel.transform.FindButton("ButtonPanel/ContinueButtonContainer");
     _columnResource         = Resources.Load <GameObject>("SimulationSummaryColumn");
     _rowItemResource        = Resources.Load <GameObject>("SimulationSummaryRowItem");
     _playerMetricsResource  = Resources.Load <GameObject>("PlayerMetricContainer");
 }
Ejemplo n.º 9
0
        protected override void OnInitialize()
        {
            // Create Game Popup
            _createGamePanel = GameObjectUtilities.FindGameObject("CreateGameContainer/CreatePanelContainer");
            _buttons         = new ButtonList("CreateGameContainer/CreatePanelContainer/ButtonPanel");

            _createGameCloseButton = _buttons.GetButton("BackButtonContainer");
            _createGamePopupButton = _buttons.GetButton("CreateButtonContainer");

            // Create Game Listener Goes Here
        }
Ejemplo n.º 10
0
        protected override void OnInitialize()
        {
            _feedbackPanel = GameObjectUtilities.FindGameObject("FeedbackContainer/FeedbackPanelContainer/FeedbackPanel");
            _columnPrefab  = Resources.Load("FeedbackColumn") as GameObject;
            _entryPrefab   = Resources.Load("FeedbackEntry") as GameObject;
            _slotPrefab    = Resources.Load("FeedbackSlot") as GameObject;
            _buttons       = new ButtonList("FeedbackContainer/FeedbackPanelContainer/FeedbackButtons");
            _error         = GameObjectUtilities.FindGameObject("FeedbackContainer/FeedbackPanelContainer/Error");

            _sendButton = _buttons.GetButton("SendButtonContainer");
        }
Ejemplo n.º 11
0
        public void Initialize()
        {
            // get player entity item storage component
            if (_director.Player.Entity.TryGetComponent(out ItemStorage itemStorage) == false)
            {
                throw new SimulationIntegrationException("No item storage found on player");
            }
            var inventoryGameObject    = GameObjectUtilities.FindGameObject("Game/Canvas/ItemPanel/ItemContainer_Inventory");
            var inventoryItemContainer = itemStorage.Items[0] as InventoryItemContainer;

            _inventoryItem = new ItemPanelContainer(_director, inventoryGameObject, -1, inventoryItemContainer, false);
        }
Ejemplo n.º 12
0
 protected override void OnInitialize()
 {
     _settingsPanel = GameObjectUtilities.FindGameObject("SettingsContainer/SettingsPanelContainer");
     _creator       = _settingsPanel.GetComponentInChildren <SettingCreation>();
     _creator.Wipe();
     _creator.SetLabelAlignment(TextAnchor.MiddleLeft);
     _creator.TryLanguageForPlatform(out _language, false, true, "SETTINGS_LABEL_LANGUAGE");
     _creator.TryResolutionForPlatform(out _resolution, 960, 540, null, false, true, "SETTINGS_LABEL_RESOLUTION");
     _creator.TryFullScreenForPlatform(out _fullScreen, true, "SETTINGS_LABEL_FULLSCREEN");
     _cancel = GameObjectUtilities.FindGameObject("SettingsContainer/SettingsPanelContainer/ButtonPanel/CancelButtonContainer").GetComponent <Button>();
     _apply  = GameObjectUtilities.FindGameObject("SettingsContainer/SettingsPanelContainer/ButtonPanel/ApplyButtonContainer").GetComponent <Button>();
 }
Ejemplo n.º 13
0
        protected override void OnInitialize()
        {
            // Join Game Popup
            _joinGamePanel = GameObjectUtilities.FindGameObject("JoinGameContainer/JoinPanelContainer");
            _buttons       = new ButtonList("JoinGameContainer/JoinPanelContainer/ButtonPanel");

            _backButton    = _buttons.GetButton("BackButtonContainer");
            _refreshButton = _buttons.GetButton("RefreshButtonContainer");

            _gameListObject = GameObjectUtilities.FindGameObject("JoinGameContainer/JoinPanelContainer/GameListContainer/Viewport/Content");
            _gameItemPrefab = Resources.Load("GameItem") as GameObject;
        }
Ejemplo n.º 14
0
    protected override void OnInitialize()
    {
        _panel      = GameObjectUtilities.FindGameObject(_panelRoute);
        _background = GameObjectUtilities.FindGameObject("BackgroundContainer/CallBackgroundImage");

        _characterMood    = GameObjectUtilities.FindGameObject(_panelRoute + "/ReviewPanel/StatusBar/MoodPanel/FillBar").GetComponent <Image>();
        _reviewContent    = GameObjectUtilities.FindGameObject(_panelRoute + "/ReviewPanel/Scroll View").GetComponent <ScrollRect>();
        _clientChatPrefab = Resources.Load <GameObject>("Prefabs/ClientChatFeedbackItem");
        _playerChatPrefab = Resources.Load <GameObject>("Prefabs/PlayerChatFeedbackItem");
        _feedbackPrefab   = Resources.Load <GameObject>("Prefabs/FeedbackElement");

        GameObjectUtilities.FindGameObject(_panelRoute + "/ReviewPanel/NextButton").GetComponent <Button>().onClick.AddListener(() => NextClickedEvent?.Invoke());
    }
Ejemplo n.º 15
0
        protected override void OnInitialize()
        {
            _chatPanel            = GameObjectUtilities.FindGameObject("Voice/VoicePanelContainer").gameObject;
            _playerChatItemPrefab = Resources.Load("PlayerChatEntry") as GameObject;
            _pushToTalkText       = _chatPanel.transform.Find("PushToTalk");
            _pressToTalkButton    = GameObjectUtilities.FindGameObject("Voice/PressToTalkButtonContainer").GetComponent <Button>();

            _toTalkToggle = PlatformUtils.IsMobile
                        ? _pressToTalkButton.gameObject
                        : _pushToTalkText.gameObject;

            Localization.LanguageChange += OnLanguageChange;
            OnLanguageChange();
        }
    protected override void OnInitialize()
    {
        _panel      = GameObjectUtilities.FindGameObject(_panelRoute);
        _background = GameObjectUtilities.FindGameObject("BackgroundContainer/GameBackgroundImage");

        _characterPrefab = Resources.Load <GameObject>("Prefabs/Characters/Generic");
        _characterPanel  = GameObjectUtilities.FindGameObject(_panelRoute + "/CharacterPanel").transform;

        _choiceItemPrefab = Resources.Load <GameObject>("Prefabs/DialogueItemScroll");
        _listChoicePrefab = Resources.Load <GameObject>("Prefabs/ListChoiceGroup");
        _dialoguePanel    = GameObjectUtilities.FindGameObject(_panelRoute + "/QuestionnaireUI/QuestionPanel/AnswerPanel").transform;

        _questionText = GameObjectUtilities.FindGameObject(_panelRoute + "/QuestionnaireUI/QuestionPanel/QuestionHolder/Question").GetComponent <Text>();
    }
Ejemplo n.º 17
0
 private void Take(ItemContainerBehaviour container)
 {
     if (!IsInvoking(nameof(DisableOptions)) && !IsInvoking("EnableOptions"))
     {
         if (GameObjectUtilities.FindGameObject("Game/Canvas/ItemPanel/ItemContainer_Inventory").GetComponent <ItemContainerBehaviour>().TryGetItem(out var inventory))
         {
             PlayerCommands.SwapInventoryItem(Id, container.ContainerIndex, inventory.Id);
         }
         else
         {
             PlayerCommands.PickupItem(Id);
         }
     }
 }
Ejemplo n.º 18
0
        protected override void OnInitialize()
        {
            // Main Menu
            _menuPanel = GameObject.Find("PauseContainer").transform.GetChild(0).gameObject;
            _buttons   = new ButtonList("PauseContainer/PausePanelContainer/PauseContainer");

            _continueButton = _buttons.GetButton("ContinueButtonContainer");
            _settingsButton = _buttons.GetButton("SettingsButtonContainer");
            _quitButton     = _buttons.GetButton("QuitButtonContainer");

            _gameContainer       = GameObjectUtilities.FindGameObject("Game/Canvas");
            _canvasGroup         = _gameContainer.GetComponent <CanvasGroup>();
            _director.GameEnded += OnEndGame;
        }
Ejemplo n.º 19
0
        protected override void OnInitialize()
        {
            // Join Game Popup
            _scenarioPanel = GameObjectUtilities.FindGameObject("ScenarioContainer/ScenarioContainer");

            _backButton = GameObjectUtilities.FindGameObject("ScenarioContainer/ScenarioContainer/ButtonPanel/BackButtonContainer").GetComponent <Button>();

            _scenarioSelectPanel = GameObjectUtilities.FindGameObject("ScenarioContainer/ScenarioContainer/ScenarioSelected");
            _selectedName        = GameObjectUtilities.FindGameObject("ScenarioContainer/ScenarioContainer/ScenarioSelected/Name Border/Name").GetComponent <Text>();
            _selectedDescription = GameObjectUtilities.FindGameObject("ScenarioContainer/ScenarioContainer/ScenarioSelected/Description Border/Description").GetComponent <Text>();
            _selectButton        = GameObjectUtilities.FindGameObject("ScenarioContainer/ScenarioContainer/ButtonPanel/SelectButtonContainer").GetComponent <Button>();

            _scenarioListObject = GameObjectUtilities.FindGameObject("ScenarioContainer/ScenarioContainer/ScenarioListContainer/Viewport/Content");
            _scenarioItemPrefab = Resources.Load("ScenarioItem") as GameObject;
        }
Ejemplo n.º 20
0
        private void Fade()
        {
            var gameContainer = GameObjectUtilities.FindGameObject("Game/Canvas");

            gameContainer.SetActive(false);
            var canvasGroup = gameContainer.GetComponent <CanvasGroup>();

            canvasGroup.alpha          = 1;
            canvasGroup.blocksRaycasts = true;
            foreach (var trail in gameContainer.GetComponentsInChildren <TrailRenderer>())
            {
                trail.startColor = new Color(trail.startColor.r, trail.startColor.g, trail.startColor.b, 1);
                trail.endColor   = new Color(trail.startColor.r, trail.startColor.g, trail.startColor.b, 0.875f);
            }
        }
Ejemplo n.º 21
0
        protected override void OnInitialize()
        {
            _lobbyPanel = GameObject.Find("LobbyContainer").transform.GetChild(0).gameObject;
            _buttons    = new ButtonList("LobbyContainer/LobbyPanelContainer/ButtonPanel");

            _backButton       = _buttons.GetButton("BackButtonContainer");
            _readyButton      = _buttons.GetButton("ReadyButtonContainer");
            _changeIconButton = _buttons.GetButton("ChangeIconButtonContainer");

            _roomNameObject   = GameObjectUtilities.FindGameObject("LobbyContainer/LobbyPanelContainer/LobbyPanel/RoomNameContainer/RoomName");
            _playerListObject = GameObjectUtilities.FindGameObject("LobbyContainer/LobbyPanelContainer/LobbyPanel/PlayerListContainer");

            _playerItemPrefab  = Resources.Load("PlayerItem") as GameObject;
            _playerSpacePrefab = Resources.Load("PlayerSpace") as GameObject;
        }
Ejemplo n.º 22
0
 protected override void OnInitialize()
 {
     _panel                 = GameObjectUtilities.FindGameObject(_panelRoute);
     _background            = GameObjectUtilities.FindGameObject("BackgroundContainer/GameBackgroundImage");
     _characterFemalePrefab = Resources.Load <CharacterFaceController>("Prefabs/Characters/Female");
     _characterMalePrefab   = Resources.Load <CharacterFaceController>("Prefabs/Characters/Male");
     _characterPanel        = GameObjectUtilities.FindGameObject(_panelRoute + "/CharacterPanel").transform;
     _choiceItemPrefab      = Resources.Load <GameObject>("Prefabs/DialogueItemScroll");
     _listChoicePrefab      = Resources.Load <ScrollRect>("Prefabs/ListChoiceGroup");
     _dialoguePanel         = GameObjectUtilities.FindGameObject(_panelRoute + "/GameUI/BottomPanel/DialogueOptionPanel").transform;
     _npcDialoguePanel      = GameObjectUtilities.FindGameObject(_panelRoute + "/GameUI/BottomPanel/NPCTextHolder/NPCText").GetComponent <Text>();
     _characterMood         = GameObjectUtilities.FindGameObject(_panelRoute + "/GameUI/TopBarPanel/StatusBar/Image").GetComponent <Image>();
     _feedbackPanel         = GameObjectUtilities.FindGameObject(_panelRoute + "/GameUI/FeedbackPanel/IconHolder");
     _feedbackElementPrefab = Resources.Load <GameObject>("Prefabs/FeedbackElement");
     GameObjectUtilities.FindGameObject(_panelRoute + "/GameUI/TopBarPanel/ModulesButton").GetComponent <Button>().onClick.AddListener(() => CommandQueue.AddCommand(new ToggleModulesCommand()));
 }
Ejemplo n.º 23
0
        private void PlayersUpdated(List <ITAlertPlayer> players)
        {
            CheckShowToTalk(players.Count);

            foreach (var player in players)
            {
                if (_playerVoiceItems.TryGetValue(player.PhotonId, out var playerVoiceItem) == false)
                {
                    var playerItem = Object.Instantiate(_playerChatItemPrefab);


                    var nameText = playerItem.transform.FindText("Name");
                    nameText.text = player.Name;

                    var scoreText = playerItem.transform.FindText("PlayerScore");

                    var scoreIncrementText = scoreText.transform.FindText("ScoreChange");

                    var soundIcon = playerItem.transform.FindImage("SoundIcon");


                    playerItem.transform.SetParent(_chatPanel.transform, false);

                    playerVoiceItem = new PlayerVoiceItem
                    {
                        GameObject         = playerItem,
                        VoiceIcon          = soundIcon,
                        NameText           = nameText,
                        ScoreText          = scoreText,
                        ScoreIncrementText = scoreIncrementText
                    };

                    _playerVoiceItems.Add(player.PhotonId, playerVoiceItem);
                }
                UpdatePlayerVoiceItem(player, playerVoiceItem);
            }
            foreach (var playerVoiceItem in _playerVoiceItems)
            {
                if (players.All(p => p.PhotonId != playerVoiceItem.Key))
                {
                    Object.Destroy(playerVoiceItem.Value.GameObject);
                }
            }
            _playerVoiceItems = _playerVoiceItems.Where(p => p.Value.GameObject != null).ToDictionary(p => p.Key, p => p.Value);
            _playerIdPair     = GameObjectUtilities.FindGameObject("Game").GetComponentsInChildren <PlayerBehaviour>(true).ToDictionary(p => p.PhotonId, p => p.Id);
        }
Ejemplo n.º 24
0
        private void ShowEndGameScore(TeamScoringSystem teamScoringSystem, List <ITAlertPlayer> players)
        {
            var parent = _teamScoresParent.transform;

            foreach (Transform t in parent)
            {
                Destroy(t.gameObject);
            }

            var playerScores = teamScoringSystem.GetPlayerScores();
            var multiplier   = teamScoringSystem.GetAverageHealth();
            var finalScore   = teamScoringSystem.GetTeamScore();

            foreach (var scores in playerScores)
            {
                var playerbehaviours = GameObjectUtilities.FindGameObject("Game").GetComponentsInChildren <PlayerBehaviour>().ToDictionary(p => p.Id, p => p.PhotonId);
                playerbehaviours.TryGetValue(scores.PlayerEntityId, out var playerPhotonId);

                var player = players.FirstOrDefault(p => p.PhotonId == playerPhotonId);

                if (player == null)
                {
                    player = new ITAlertPlayer()
                    {
                        Colour = "#FFFFFF", Name = "Temp Player"
                    };
                }
                CreateScoreObject(parent, player.Name, scores.PublicScore.ToString(), player.Colour);
            }

            // now create the multiplier object
            var multiplierObj = parent.transform.parent.Find("Multiplier").gameObject;

            SetupScoreObject(multiplierObj, Localization.Get("GAME_OVER_MULTIPLIER"), multiplier.ToString(Localization.SpecificSelectedLanguage));
            // Finally create the final score object

            var finalScoreObj = parent.transform.parent.Find("FinalScore").gameObject;

            SetupScoreObject(finalScoreObj, Localization.Get("GAME_OVER_FINAL_SCORE"), finalScore.ToString(Localization.SpecificSelectedLanguage));

            parent.gameObject.BestFit();
            multiplierObj.BestFit();
            finalScoreObj.BestFit();
        }
Ejemplo n.º 25
0
        protected override void OnEnter()
        {
            ColorUtility.TryParseHtmlString(_photonClient.CurrentRoom.Player.Colour, out var color);
            if (color == Color.white)
            {
                ColorUtility.TryParseHtmlString("#" + _photonClient.CurrentRoom.Player.Colour, out color);
            }
            GameObjectUtilities.FindGameObject("Game/Canvas/Border").GetComponent <Image>().color = color;
            _gameContainers.ForEach(g => g.SetActive(true));
            _continueButton.onClick.AddListener(OnContinueClick);
            PlayGen.Unity.Utilities.Loading.Loading.Stop();
            var gameContainer = GameObjectUtilities.FindGameObject("Game/Canvas");

            gameContainer.SetActive(true);
            if (!_endGame)
            {
                var canvasGroup = gameContainer.GetComponent <CanvasGroup>();
                canvasGroup.alpha          = 1;
                canvasGroup.blocksRaycasts = true;
            }
        }
Ejemplo n.º 26
0
    protected override void OnInitialize()
    {
        _panel      = GameObjectUtilities.FindGameObject(_panelRoute);
        _background = GameObjectUtilities.FindGameObject("BackgroundContainer/MenuBackgroundImage");
        _creator    = GameObjectUtilities.FindGameObject(_panelRoute + "/SettingsPanel").GetComponentInChildren <SettingCreation>();
        _creator.Wipe();
        Dropdown feedback;

        _creator.TryForPlatform("FEEDBACK_MODE", true, out feedback, true, false);
        feedback.GetComponent <DropdownLocalization>().SetOptions(new List <string> {
            "FEEDBACK_" + ScenarioController.FeedbackMode.EndGame, "FEEDBACK_" + ScenarioController.FeedbackMode.InReview, "FEEDBACK_" + ScenarioController.FeedbackMode.InGame
        });
        feedback.value = PlayerPrefs.GetInt("Feedback", (int)ScenarioController.FeedbackMode.EndGame);
        feedback.onValueChanged.AddListener(OnFeedbackChange);
        _feedbackMode = feedback.Parent();
        Dropdown language;

        _creator.TryLanguageForPlatform(out language, true, false);
        language.onValueChanged.AddListener(OnLanguageChange);
        _creator.RebuildLayout();
        GameObjectUtilities.FindGameObject(_panelRoute + "/SettingsPanel/BackButton").GetComponent <Button>().onClick.AddListener(OnBackClick);
    }
Ejemplo n.º 27
0
 protected override void OnEnter()
 {
     GameObjectUtilities.FindGameObject("SplashContainer/SplashPanel").SetActive(true);
     // Load stuff
 }
Ejemplo n.º 28
0
 protected override void OnExit()
 {
     GameObjectUtilities.FindGameObject("SplashContainer/SplashPanel").SetActive(false);
 }
Ejemplo n.º 29
0
 protected override void OnInitialize()
 {
     GameObjectUtilities.FindGameObject("Game/Canvas/Graph");
 }
Ejemplo n.º 30
0
        public void OnPointerClick(ItemContainerBehaviour container, Director director)
        {
            if (director.Player.CurrentLocationEntity.EntityBehaviour.Entity.CreatedFromArchetype != nameof(ConnectionNode) && !_selectionOptions.activeSelf && CanActivate && !IsInvoking("OptionsDelay") && !IsInvoking(nameof(ResetOptions)) && !IsInvoking("EnableOptions"))
            {
                _leftButton.transform.localScale             = Vector3.one;
                _rightButton.transform.localScale            = Vector3.one;
                _middleButton.transform.localScale           = Vector3.one;
                _descriptionText.transform.parent.localScale = Vector3.one;
                GetComponent <Canvas>().sortingOrder         = 100;
                Invoke("OptionsDelay", Time.smoothDeltaTime * 2);
                Invoke("EnableOptions", 0.34f);
                _selectionOptions.SetActive(true);
                if (container.CanRelease && CanActivate && CurrentLocation.Value != null)
                {
                    var validMoveExists    = true;
                    var currentLocation    = director.Player.CurrentLocationEntity;
                    var subsystemBehaviour = currentLocation.EntityBehaviour as SubsystemBehaviour;
                    if (subsystemBehaviour != null && subsystemBehaviour.ItemStorage != null)
                    {
                        var containers = subsystemBehaviour.GetComponentsInChildren <ItemContainerBehaviour>().Where(c => c != container).ToList();
                        validMoveExists = containers.Any(c => c.CanContain(Id) && c.IsEnabled && (!c.TryGetItem(out var cItem) || container.CanContain(cItem.Id)));
                    }
                    GameObjectUtilities.FindGameObject("Game/Canvas/ItemPanel/ItemContainer_Inventory").GetComponent <ItemContainerBehaviour>().TryGetItem(out var inventory);
                    var canTake = !inventory || container.CanContain(inventory.Id);
                    _leftButton.SetActive(Director.CommandSystem.TryGetHandler(typeof(ActivateItemCommand), out var activateHandler) && activateHandler.Enabled);
                    _leftButton.GetComponent <Button>().onClick.RemoveAllListeners();
                    _leftButton.GetComponent <Button>().onClick.AddListener(Use);
                    _leftButton.GetComponentInChildren <Text>().text            = Localization.Get("USE_BUTTON");
                    _leftButton.GetComponentInChildren <TextLocalization>().Key = "USE_BUTTON";
                    _rightButton.SetActive(canTake && Director.CommandSystem.TryGetHandler(typeof(PickupItemCommand), out var pickUpHandler) && pickUpHandler.Enabled && Director.CommandSystem.TryGetHandler(typeof(SwapInventoryItemCommand), out pickUpHandler) && pickUpHandler.Enabled);
                    _rightButton.GetComponent <Button>().onClick.RemoveAllListeners();
                    _rightButton.GetComponent <Button>().onClick.AddListener(() => Take(container));
                    _rightButton.GetComponentInChildren <Text>().text            = Localization.Get("TAKE_BUTTON");
                    _rightButton.GetComponentInChildren <TextLocalization>().Key = "TAKE_BUTTON";
                    _middleButton.SetActive(validMoveExists && Director.CommandSystem.TryGetHandler(typeof(MoveItemCommand), out var moveHandler) && moveHandler.Enabled && Director.CommandSystem.TryGetHandler(typeof(SwapSubsystemItemCommand), out moveHandler) && moveHandler.Enabled);
                    _middleButton.GetComponent <Button>().onClick.RemoveAllListeners();
                    _middleButton.GetComponent <Button>().onClick.AddListener(() => Move(container, director));
                    _middleButton.GetComponentInChildren <Text>().text            = Localization.Get("MOVE_BUTTON");
                    _middleButton.GetComponentInChildren <TextLocalization>().Key = "MOVE_BUTTON";
                    var bestFitSize = _selectionOptions.GetComponentsInChildren <Button>().BestFit(true, new List <string> {
                        Localization.Get("USE_BUTTON"), Localization.Get("MOVE_BUTTON"), Localization.Get("TAKE_BUTTON")
                    });
                    _descriptionText.fontSize = bestFitSize;
                }
                else if (!container.CanRelease && CanActivate && CurrentLocation.Value != null)
                {
                    _leftButton.SetActive(false);
                    _rightButton.SetActive(false);
                    _middleButton.SetActive(Director.CommandSystem.TryGetHandler(typeof(ActivateItemCommand), out var activateHandler) && activateHandler.Enabled);
                    _leftButton.GetComponent <Button>().onClick.RemoveAllListeners();
                    _rightButton.GetComponent <Button>().onClick.RemoveAllListeners();
                    _middleButton.GetComponent <Button>().onClick.RemoveAllListeners();
                    _middleButton.GetComponent <Button>().onClick.AddListener(Use);
                    _middleButton.GetComponentInChildren <Text>().text            = Localization.Get("USE_BUTTON");
                    _middleButton.GetComponentInChildren <TextLocalization>().Key = "USE_BUTTON";
                    var bestFitSize = _selectionOptions.GetComponentsInChildren <Button>().BestFit(true, new List <string> {
                        Localization.Get("USE_BUTTON"), Localization.Get("MOVE_BUTTON"), Localization.Get("TAKE_BUTTON")
                    });
                    _descriptionText.fontSize = bestFitSize;
                }
                else if (CurrentLocation.Value == null)
                {
                    _leftButton.SetActive(Director.CommandSystem.TryGetHandler(typeof(DropAndActivateItemCommand), out var dropAndActivateHandler) && dropAndActivateHandler.Enabled && Director.CommandSystem.TryGetHandler(typeof(SwapInventoryItemAndActivateCommand), out dropAndActivateHandler) && dropAndActivateHandler.Enabled);
                    _rightButton.SetActive(Director.CommandSystem.TryGetHandler(typeof(DropItemCommand), out var dropHandler) && dropHandler.Enabled && Director.CommandSystem.TryGetHandler(typeof(SwapInventoryItemCommand), out dropHandler) && dropHandler.Enabled);
                    _middleButton.SetActive(false);
                    _middleButton.GetComponent <Button>().onClick.RemoveAllListeners();
                    _leftButton.GetComponent <Button>().onClick.RemoveAllListeners();
                    _leftButton.RectTransform().anchorMin        = new Vector2(-1.5f, 1f);
                    _leftButton.RectTransform().anchorMax        = new Vector2(0, 1.7f);
                    _leftButton.RectTransform().anchoredPosition = Vector2.zero;
                    _leftButton.RectTransform().sizeDelta        = Vector2.zero;
                    _leftButton.GetComponent <Button>().onClick.AddListener(() => MoveAndUse(container, director));
                    _leftButton.GetComponentInChildren <Text>().text            = Localization.Get("PLACE_AND_USE_BUTTON");
                    _leftButton.GetComponentInChildren <TextLocalization>().Key = "PLACE_AND_USE_BUTTON";

                    _rightButton.GetComponent <Button>().onClick.RemoveAllListeners();
                    _rightButton.RectTransform().anchorMin        = new Vector2(1f, 1f);
                    _rightButton.RectTransform().anchorMax        = new Vector2(2.5f, 1.7f);
                    _rightButton.RectTransform().anchoredPosition = Vector2.zero;
                    _rightButton.RectTransform().sizeDelta        = Vector2.zero;
                    _rightButton.GetComponent <Button>().onClick.AddListener(() => Move(container, director));
                    _rightButton.GetComponentInChildren <Text>().text            = Localization.Get("PLACE_BUTTON");
                    _rightButton.GetComponentInChildren <TextLocalization>().Key = "PLACE_BUTTON";
                    _selectionOptions.GetComponentsInChildren <Button>().BestFit(true, new List <string> {
                        Localization.Get("PLACE_BUTTON"), Localization.Get("PLACE_AND_USE_BUTTON")
                    });
                }
                else
                {
                    _leftButton.SetActive(false);
                    _rightButton.SetActive(false);
                    _middleButton.SetActive(false);
                }
                var optionAnim = _selectionOptions.GetComponent <Animation>();
                var clipName   = CurrentLocation.Value != null ? optionAnim.clip.name : optionAnim.clip.name + "Inventory";
                optionAnim[clipName].time  = 0;
                optionAnim[clipName].speed = 1;
                optionAnim.Play(clipName);
                _selectPos = transform.position;
            }
        }