示例#1
0
    private IEnumerator WaitForHangar()
    {
        Window w = GetComponentInParent <Window>();

        w.SetLoading(true);
        float time = 3.0f;

        while (!_hangar.Loaded)
        {
            if (time > 2.0f)
            {
                WideDataManager.wideDataManager.SendRequest(new LoadHangarRequest(_hangar.ID));
                time = 0.0f;
            }
            time += Time.deltaTime;
            yield return(null);
        }
        foreach (int i in _hangar.StacksIDs)
        {
            ResourceStack r = LocalDataManager.instance.GetResourceStackInfo(i);
            while (!r.Loaded)
            {
                yield return(null);
            }
        }
        long?id   = -1;
        bool loop = true;

        WideDataManager.RequestCB frameMethCB = delegate(Request r) {
            if (r.RequestID == id)
            {
                loop = false;
            }
        };
        WideDataManager.wideDataManager.OnRequestResult += frameMethCB;
        id = WideDataManager.Request(new GetFlightPlanRequest(LocalDataManager.instance.LocalCorporation.FlightPlans));
        while (loop)
        {
            yield return(null);
        }
        WideDataManager.wideDataManager.OnRequestResult -= frameMethCB;

        UpdateShips();
        UpdateResources();

        w.SetLoading(false);
        yield break;
    }
    private IEnumerator WaitForPlans()
    {
        bool loop = true;
        long?id   = 0;

        WideDataManager.RequestCB frameMethCB = delegate(Request r) {
            if (r.RequestID == id)
            {
                loop = false;
            }
        };

        WideDataManager.wideDataManager.OnRequestResult += frameMethCB;
        id = WideDataManager.Request(new GetFlightPlanRequest(_corp.FlightPlans));
        while (loop)
        {
            yield return(null);
        }
        WideDataManager.wideDataManager.OnRequestResult -= frameMethCB;

        UpdateList();
    }