mirror of
				https://github.com/DerTyp7/defrain-shooter-unity.git
				synced 2025-10-31 13:37:08 +01:00 
			
		
		
		
	added network movement
This commit is contained in:
		
							
								
								
									
										28
									
								
								Assets/Scripts/Player/PlayerNetworkingScript.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								Assets/Scripts/Player/PlayerNetworkingScript.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
| using MLAPI; | ||||
| using MLAPI.NetworkVariable; | ||||
| using MLAPI.Transports; | ||||
| using MLAPI.Messaging; | ||||
| using TMPro; | ||||
|  | ||||
| public class PlayerNetworkingScript : NetworkBehaviour | ||||
| { | ||||
|     public NetworkVariableInt dice = new NetworkVariableInt(new NetworkVariableSettings | ||||
|     { | ||||
|         WritePermission = NetworkVariablePermission.ServerOnly, | ||||
|         ReadPermission = NetworkVariablePermission.Everyone | ||||
|     }); | ||||
|  | ||||
|     private void Update() | ||||
|     { | ||||
|         if (Input.GetKeyDown(KeyCode.J)) | ||||
|         { | ||||
|             Debug.Log("J"); | ||||
|             NetworkManager.Singleton.StopHost(); | ||||
|             NetworkManager.Singleton.StartClient(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 DerTyp187
					DerTyp187