Search Unity

[question] GUI-elements dont change in build.

Discussion in 'Scripting' started by Grim_Reaper, Jul 20, 2014.

  1. Grim_Reaper

    Grim_Reaper

    Joined:
    Nov 5, 2013
    Posts:
    32
    Hi,
    i have a strange problem here:
    i have been following the networking tutorials found here in the forum: http://forum.unity3d.com/threads/tutorial-building-a-multiplayer-fps-in-unity-3d.216804/

    In his 4th video quill18 is showing how to display the connection status.
    Everything works fine so far, but if i build the game, the status is displayed and when it changes it just gets interleaved the previous status and the next status interleave again and i have everything on one place.
    Why i am asking here and not asking quill18 directly?
    -> This happens with the rest of my GUI as well.
    I have a menu, which gets changed by a delegate. If a button is clicked the gelegate changes to another method and displays the next part of the menu.
    like this (shorted):
    Code (CSharp):
    1. protected override void Start()
    2.         {
    3.             delegateMenu = loginMenu;
    4.         }
    5.  
    6. public void OnGUI()
    7.         {
    8.             GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
    9.             GUILayout.Label(menuLabel);
    10.             delegateMenu();
    11.         }
    12.  
    Did i miss some settings? Someone have suggestions?
    Please help.

    // edit
    here is the video:


    // Edit2
    Really nobody some ideas? I have been trying to fix it about 12 hours....
    Maybe some more information needed?
    I am using the strangeioc framework, but i have already tried to setup the menu without have integrated it in the framework. The error is still there.
    At the moment there is a nullreferenceexception fireing around after i stop the game. But i dont think it has something to do with the menu problem, because, it points to a class belongs to the framework and, like i wrote, same problem existing without implementation of the menu in the framework.
    I will try to fix the exception problem anyway.
    Still hope for some help.

    // Edit3
    looks like i'm soliloquizing...
    But there are happening strange things with this engine.
    After opening another (older) project where i have a similar menu just to try out. The old menu worked perfectly. I compared the scripts and found no big differences between them.
    BUT, After loading the new project back again and starting the game in the editor, the NullReferenceException did not fire anymore.
    In fact, this is good, but it makes no sense....
    Found out that the NullReferenceException appears because of the StrangeIoC-framework i am using, every time an Event is not completed and the game is closed i get the Exception thrown.

    The Error with the menu in the build (shown in the video) is still there...

    Thanks.
     
    Last edited: Jul 21, 2014
  2. noooodley

    noooodley

    Joined:
    Jun 25, 2013
    Posts:
    4
    Last edited: Jul 23, 2014
    Grim_Reaper likes this.
  3. Grim_Reaper

    Grim_Reaper

    Joined:
    Nov 5, 2013
    Posts:
    32
    Thank you very much for the help.
    Im on my way to work. Will try to fix it in the evening. Probably the camera will bei the solution. :)

    //Edit
    @ home now, tried out, working fine :)
    Thank you :)
     
    Last edited: Jul 23, 2014