Пример #1
0
        public void SetCurrentPlayersTurn(FishBucket.FishBucketPlayerData playerData, bool isLocalPlayer)
        {
            if (currentPlayerHud != null)
            {
                currentPlayerHud.SetHighlighted(highlighted: false);
            }
            if (currentPlayerId != 0)
            {
                dispatcher.DispatchEvent(new PlayerIndicatorEvents.RemovePlayerIndicator(currentPlayerId, isStored: false, destroy: false));
            }
            currentPlayerId  = playerData.PlayerId;
            currentPlayerHud = playerHuds[playerData.PlayerId];
            currentPlayerHud.SetHighlighted(highlighted: true);
            string text = "";

            text            = ((!isLocalPlayer) ? string.Format(localizer.GetTokenTranslation("Activity.FishCatch.OthersTurn"), playerData.DisplayName) : localizer.GetTokenTranslation("Activity.FishCatch.TurnInstruction"));
            HeaderText.text = text;
            if (turnIndicator == null)
            {
                createTurnIndicator();
            }
            dispatcher.DispatchEvent(new PlayerIndicatorEvents.ShowPlayerIndicator(turnIndicator.gameObject, currentPlayerId));
            turnIndicatorAnimator.SetTrigger(ANIMATOR_HASH_TURN_INDICATOR_OPEN);
            turnIndicator.StartCountdown(fishBucketDefinition.TurnTimeInSeconds);
        }
Пример #2
0
        private IEnumerator loadPlayerHuds(Dictionary <long, FishBucket.FishBucketPlayerData> playerData)
        {
            AssetRequest <GameObject> request = Content.LoadAsync(PLAYER_BUCKET_KEY);

            yield return(request);

            playerHuds = new Dictionary <long, FishBucketPlayerHud>();
            foreach (FishBucket.FishBucketPlayerData value in playerData.Values)
            {
                FishBucketPlayerHud component = Object.Instantiate(request.Asset, PlayerBucketPanel.transform, worldPositionStays: false).GetComponent <FishBucketPlayerHud>();
                component.Init(value);
                component.SetHighlighted(highlighted: false);
                playerHuds.Add(value.PlayerId, component);
            }
        }