Example #1
0
        private IEnumerator setUpStartPositions()
        {
            Vector3[] playerPositions = new Vector3[base.players.Count - 1];
            Vector3[] gamePositions   = new Vector3[1];
            Vector3   ownerPosition   = localPlayerGameObject.transform.position;
            AssetRequest <GameObject> assetRequest = Content.LoadAsync(PLAYER_POSITION_PREFAB_KEY);

            yield return(assetRequest);

            Vector3 cameraDirection = Camera.main.transform.position - localPlayerGameObject.transform.position;

            cameraDirection.y = 0f;
            PartyGameSpawnLocationValidator spawnLocations = UnityEngine.Object.Instantiate(assetRequest.Asset, ownerPosition, Quaternion.LookRotation(cameraDirection)).GetComponent <PartyGameSpawnLocationValidator>();

            yield return(null);

            PartyGameSessionMessages.SetGameStartData startPositions = new PartyGameSessionMessages.SetGameStartData
            {
                OwnerPosition = spawnLocations.GetPlayerPosition(0)
            };
            for (int i = 1; i < base.players.Count && i < spawnLocations.PlayerPositions.Length; i++)
            {
                ref Vector3 reference = ref playerPositions[i - 1];
                reference = spawnLocations.GetPlayerPosition(i);
            }
Example #2
0
 private void handleSetGameStartPositions(PartyGameSessionMessages.SetGameStartData data)
 {
     if (currentState != 0)
     {
         return;
     }
     CoroutineRunner.Start(createCannon(data.GamePositions[0]), this, "CreateFishBucketCannon");
     if (localPlayerSessionId == base.players[0].UserSessionId)
     {
         CoroutineRunner.Start(MoveLocalPlayerToPosition(data.OwnerPosition, data.GamePositions[0]), this, "");
     }
     else
     {
         int num = base.players.FindIndex((PartyGamePlayer p) => p.UserSessionId == localPlayerSessionId) - 1;
         CoroutineRunner.Start(MoveLocalPlayerToPosition(data.PlayerPositions[num], data.GamePositions[0]), this, "");
     }
     totalCards = data.IntData[0];
     if (hudUI != null)
     {
         hudUI.SetTotalCards(totalCards);
     }
 }