I used this code (and similar but with the same errors). I also tried GuiLayout.label
GUI.Label(Rect(10,10,100,30),"Test");
The errors that I get:
Assets/Scripts/NetworkManager.cs(15,27): error CS0119: Expression denotes a type', where a
variable’, value' or
method group’ was expected
Assets/Scripts/NetworkManager.cs(15,21): error CS1502: The best overloaded method match for `UnityEngine.GUI.Label(UnityEngine.Rect, string)’ has some invalid arguments
Assets/Scripts/NetworkManager.cs(15,21): error CS1503: Argument #1' cannot convert
object’ expression to type `UnityEngine.Rect’
I was using this script also without any errors but here I can’t see the text…
using UnityEngine;
using System.Collections;
public class NetworkManager : Photon.MonoBehaviour {
void Start ()
{
PhotonNetwork.ConnectUsingSettings("alpha 0.1");
}
void OnGui()
{
GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
}
void OnJoinedLobby()
{
PhotonNetwork.JoinRandomRoom();
}
void OnPhotonRandomJoinFail()
{
PhotonNetwork.CreateRoom(null);
}
}