Introduced Player Height offset

This commit is contained in:
brausjonas
2023-04-03 18:54:29 +02:00
parent 85023c6d80
commit 6e177eee81
19 changed files with 1954 additions and 13 deletions
+3 -2
View File
@@ -16,6 +16,7 @@ public class Client : MonoBehaviour
private TcpClient client;
private Stream stream;
[SerializeField] private GameObject[] playerPrefab;
[SerializeField] private PlayerHeightInfo[] playerPrefabsHeightInfo;
private Player[] players = new Player[4];
private Queue<Job> jobs = new Queue<Job>();
[SerializeField] private GameObject dice;
@@ -155,7 +156,7 @@ public class Client : MonoBehaviour
GameObject player = Instantiate(playerPrefab[job.data[9]]);
playerIconInfoImages[job.data[5]].sprite = playerIconInfoImagesPrefabs[job.data[9]];
player.transform.position = new Vector3(job.data[2], job.data[3] + 0.5f, job.data[4]);
player.transform.position = new Vector3(job.data[2], job.data[3] + playerPrefabsHeightInfo[job.data[9]].heightOffset, job.data[4]);
PlayablePlayer script = player.AddComponent<PlayablePlayer>();
players[job.data[5]] = script;
@@ -188,7 +189,7 @@ public class Client : MonoBehaviour
GameObject player = Instantiate(playerPrefab[job.data[9]]);
playerIconInfoImages[job.data[5]].sprite = playerIconInfoImagesPrefabs[job.data[9]];
player.transform.position = new Vector3(job.data[2], job.data[3] + 0.5f, job.data[4]);
player.transform.position = new Vector3(job.data[2], job.data[3] + playerPrefabsHeightInfo[job.data[9]].heightOffset, job.data[4]);
NoPlayablePlayer script = player.AddComponent<NoPlayablePlayer>();
players[job.data[5]] = script;
@@ -0,0 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerHeightInfo : MonoBehaviour
{
public float heightOffset;
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0b959c5ef3e934c4aa423304f05cb0a3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -39,8 +39,8 @@ public class StartHandler : MonoBehaviour
}
else
{
PlayerPrefs.SetInt("characterID", 1);
imageShowSelectedCharacter.sprite = characterFaces[1];
PlayerPrefs.SetInt("characterID", 0);
imageShowSelectedCharacter.sprite = characterFaces[0];
}
copiedMessage.SetActive(false);