예제 #1
0
    IEnumerator WaitForLocalConnection(Tour tour)
    {
        yield return(new WaitUntil(() => NetworkServer.localConnection.isReady));

        App.activeTour = tour; // TODO make this irrelevant - we're passing the tour to the content window already
        // App.guideSync.ShowContent(App.activeTour.GetFirstFile());

        var props = new ContentWindowControllerProperties()
        {
            startWithFile = tour.GetFirstFile(false), tour = tour
        };

        App.uiFrame.OpenWindow(ScreenList.guideContentWindow, props);
    }
    IEnumerator WaitForConnection()
    {
        // TODO add timeout
        // NOT WORKING!! if started in player, changetoursignal hasnt been subscribed yet (ie networkbehaviours havent been set active)
        // possible workarounds: subscribe in a monobehaviour
        // find way of telling whether it's been subscribed
        // ugly: wait for a second
        yield return(new WaitUntil(() => NetworkClient.isConnected && NetworkClient.connection.isReady));

        var props = new ContentWindowControllerProperties()
        {
            tour = App.activeTour
        };

        App.uiFrame.OpenWindow(ScreenList.visitorContentWindow, props);

        // TODO more elegant solution for first starting file
        // right now Properties.startWithFile is null
        // and GuideSync sets the first content in a hook on clients
    }