please, I'm having a new issue... this one is related to room variables.
I made my login with a custom script. Then made a lobby room, etc.
When the user creates a new room (game room), it creates 2 variables. I checked into Admin Tool of SFS and the variables are all there, so, creating variables works.
But when I try to get the variables I got this error:
Code: Select all
InvalidCastException: Cannot cast from source type to destination type.
csFase_Core.OnGUI () (at Assets\Game\Scripts Gerais\Fases\csFase_Core.cs:207)
UnityEditor.EditorGUIUtility:RenderGameViewCameras(Rect, Rect, Boolean, Boolean)
UnityEditor.EditorGUIUtility:RenderGameViewCameras(Rect, Rect, Boolean, Boolean)
UnityEditor.GameView:OnGUI() (at C:\builds\unity-branches-2.5.x\unity-2.5.x\Editor\Mono\GameView\GameView.cs:192)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[])
System.Reflection.MonoMethod:InternalInvoke(Object, Object[])
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.HostView:Invoke(String) (at C:\builds\unity-branches-2.5.x\unity-2.5.x\Editor\Mono\GUI\DockArea.cs:156)
UnityEditor.MaximizedHostView:OnGUI() (at C:\builds\unity-branches-2.5.x\unity-2.5.x\Editor\Mono\GUI\DockArea.cs:872)
The code where the errors occurs:
Code: Select all
Hashtable vars = room.GetVariables();
foreach (string v in vars.Values) {
Debug.Log("Name: " + v + " Value: " + room.GetVariable(v));
}
The script above is the same from the documents...
What am I doing wrong?
Please help