Пример #1
0
        private IEnumerator loadPlayerHuds(long[] playerIds)
        {
            AssetRequest <GameObject> request = Content.LoadAsync(PLAYER_HUD_KEY);

            yield return(request);

            playerHuds = new Dictionary <long, FindFourPlayerHud>();
            for (int i = 0; i < playerIds.Length; i++)
            {
                FindFourPlayerHud component = Object.Instantiate(request.Asset, PlayerUIPanel.transform, worldPositionStays: false).GetComponent <FindFourPlayerHud>();
                component.Init(playerIds[i], i);
                playerHuds[playerIds[i]] = component;
            }
        }
Пример #2
0
 public void SetCurrentPlayersTurn(long playerId)
 {
     if (currentPlayerHud != null)
     {
         currentPlayerHud.SetHighlighted(highlighted: false);
     }
     currentPlayerHud = playerHuds[playerId];
     currentPlayerHud.SetHighlighted(highlighted: true);
     if (playerId == Service.Get <CPDataEntityCollection>().LocalPlayerSessionId)
     {
         currentPlayerHud.StartTimer(turnTime - YourTurnTextTime);
         SetState(FindFourHudState.YourTurnText);
         EventManager.Instance.PostEvent(YourTurnSFXTrigger, EventAction.PlaySound);
     }
     else
     {
         currentPlayerHud.StartTimer(turnTime);
         EventManager.Instance.PostEvent(OpponentTurnSFXTrigger, EventAction.PlaySound);
     }
 }