Server Sync

Player move on sync
This commit is contained in:
AliIbnAbiTalib
2023-02-20 21:51:15 +01:00
parent 12c8843fed
commit 311f141feb
14 changed files with 66 additions and 25 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ public class Client : MonoBehaviour
((NoPlayablePlayer)players[job.data[1]]).CoinFieldAction(job.data[2]);
break;
case 7:
((NoPlayablePlayer)players[job.data[1]]).EventStopFinished();
(players[job.data[1]]).EventStopFinished();
break;
case 126:
stream.Write(new byte[]{126, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 10);
+9 -6
View File
@@ -4,15 +4,18 @@ using UnityEngine;
public class ItemShop : MonoBehaviour
{
// Start is called before the first frame update
void Start()
[SerializeField] private GameObject Layout2;
[SerializeField] private GameObject LayoutItemShop;
[SerializeField] private Client client;
public void buttonMoveOn()
{
Layout2.SetActive(false);
client.EventStopFinished();
}
// Update is called once per frame
void Update()
public void buttonEnter()
{
Layout2.SetActive(false);
LayoutItemShop.SetActive(true);
}
}
@@ -152,9 +152,4 @@ public class NoPlayablePlayer : Player
}
}
public void EventStopFinished()
{
eventstop = false;
}
}
@@ -37,12 +37,13 @@ public class PlayablePlayer : Player
private void Update()
{
if (Input.GetMouseButtonDown(0))
/*
if (Input.GetMouseButtonDown(0))
{
eventstop = false;
client.EventStopFinished();
}
*/
if (activated && !name.Equals(""))
{
//Generiere Würfelzahl von 1-6 wenn gerade gewürfelt werden darf
@@ -70,4 +70,9 @@ public abstract class Player : MonoBehaviour
eventstop = true;
Layout2.SetActive(true);
}
public void EventStopFinished()
{
eventstop = false;
}
}