|
Post by EZM DEV on Feb 7, 2019 10:48:09 GMT -8
The EZM NetworkManager Example script was depreciated in the last update. For now, until the update ships, just message me and I can send it to you.
Thanks
|
|
|
Post by EZM DEV on Feb 7, 2019 11:02:36 GMT -8
here is the missing script before the last update. It helps start the test scene and rotate the lobby ect.. let me know if you have any trouble setting it up and I can give you a hand. The update should be live in the next day or two.
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.Networking; using UnityEngine.Networking.Match;
public class EZMNetworkManagerHUD : NetworkManager {
//ATT this manager is subject to be updated soon with new features. //Att: Due to a missing script I reverted back to this HUD setup for the demo during the update until I get to review the updated script again and I will put it back through. // the newer one has FFA, Teams and CO-Opt public string ipaddress; public int port;
[SerializeField] Transform playableLobbyCam; [SerializeField] float camRad = 22f; [SerializeField] float camSpeed=3f; [SerializeField] bool useRotatingScene; bool camIsRotating; float camrotation = 0f;
public void Host() { SetPort(); NetworkManager.singleton.StartHost(); } void SetPort() { networkPort = port; } void SetIP() { string _ipText = GameObject.Find("IPAddressInput").transform.Find("IPText").GetComponent<Text>().text;
ipaddress = _ipText == "" ? "localhost" : _ipText; } public void Join() { SetPort(); SetIP(); NetworkManager.singleton.StartClient(); } public override void OnStartHost() { if(useRotatingScene) camIsRotating = false;
} public override void OnStopHost() { if (useRotatingScene) camIsRotating = true; } private void Start() { camIsRotating = useRotatingScene; } private void Update() { if (camIsRotating) { camrotation += camSpeed * Time.deltaTime; if (camrotation >= 360f) camrotation -= 360f; playableLobbyCam.position = Vector3.zero; playableLobbyCam.rotation = Quaternion.Euler(0f, camrotation, 0f); playableLobbyCam.Translate(0f, camRad, -camRad); playableLobbyCam.LookAt(Vector3.zero); } } public void LeaveMultiplayer() { StopClient(); StopHost(); } }
|
|
|
Post by EZM DEV on Feb 7, 2019 11:08:02 GMT -8
it seems the simple move example was also lost here is that one for testing out simple horizontal and vertical movement over the network just drop this or the above script into the network behavior folder and it will auto find and update it to be able to add to your player
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; public class EZMSimpleMove : NetworkBehaviour {
void Update () { if (!isLocalPlayer) return; var h = Input.GetAxis("Horizontal"); var v = Input.GetAxis("Vertical"); TranslateMove(h,v); } void TranslateMove(float h, float v) { transform.Translate(new Vector3(h, 0, 0) * 3 * Time.deltaTime); transform.Translate(new Vector3(0, 0, v) * 3 * Time.deltaTime); } }
|
|