Hey guys
I’m almost finished my new game, and the only thing left to implement is the LAN multiplayer. I’ve found loads of great tutorials on this for JavaScript, but some of my game, such as the play button and player, use prefabricated C# code. I was wondering if anyone with some experience in this could please help me with this? I need to have the game finished by tomorrow, so a quick answer would be really appreciated Here’s the code for the start button for some reference:
using UnityEngine;
using System.Collections;
public class PlayButton : MonoBehaviour {
private bool _run = false;
private PlayerControl _playerControl;
void Start(){
_playerControl = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>();
}
void OnGUI () {
if (_run == false && GUI.Button (new Rect (Screen.width/2-125,Screen.height/2-35,250,70), "Play")) {
_playerControl.status = true;
_run = true;
}else if (_run == true && GUI.Button (new Rect (10,10,100,50), "Stop")) {
_playerControl.status = false;
_run = false;
}
}
}
Thanks
Harry