void Start() { controller = GetComponent<CharacterController>(); menu = GetComponent<ExampleMenu>(); // hide the cursor Cursor.visible = false; }
void Start() { controller = GetComponent <CharacterController>(); menu = GetComponent <ExampleMenu>(); // hide the cursor Cursor.visible = false; }
/// <summary> /// Keep only one instance of this object. /// </summary> void Awake() { if (Application.isPlaying) { if (mInst == null) { mInst = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } } }
/// <summary> /// Keep only one instance of this object. /// </summary> void Awake() { if (Application.isPlaying) { // Choose IPv6 or IPv4 TcpProtocol.defaultListenerInterface = (addressFamily == IPType.IP_v_6) ? System.Net.IPAddress.IPv6Any : System.Net.IPAddress.Any; // TNet will automatically switch UDP to IPv6 if TCP uses it, but you can specify an explicit one if you like //UdpProtocol.defaultNetworkInterface = useIPv6 ? System.Net.IPAddress.IPv6Any : System.Net.IPAddress.Any; if (mInst == null) { mInst = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } } }