示例#1
0
    IEnumerator magicButton()
    {
        //Non blocking wait till sendView() is finished
        yield return(sendView("/scroll/apply"));

        if (currentMmtAnswer == null)
        {
            Debug.Log("DAS HAT NICHT GEKLAPPT");
            //TODO: hier ne Art PopUp, wo drin steht, dass das nicht geklappt hat
            PushoutFactFailEvent.Invoke(null);
        }
        else
        {
            Scroll.ScrollApplicationInfo pushout = JsonConvert.DeserializeObject <Scroll.ScrollApplicationInfo>(currentMmtAnswer);
            readPushout(pushout.acquiredFacts);
        }
    }
示例#2
0
    private void readPushout(List <Scroll.ScrollFact> pushoutFacts)
    {
        FactManager factManager = cursor.GetComponent <FactManager>();

        if (pushoutFacts.Count == 0)
        {
            PushoutFactFailEvent.Invoke(null);
        }

        bool samestep = false;

        for (int i = 0; i < pushoutFacts.Count; i++, samestep = true)
        {
            Fact newFact = ParsingDictionary.parseFactDictionary[pushoutFacts[i].getType()].Invoke(pushoutFacts[i]);
            if (newFact != null)
            {
                PushoutFactEvent.Invoke(FactManager.AddFactIfNotFound(newFact, out bool exists, samestep));
            }
            else
            {
                Debug.Log("Parsing on pushout-fact returned null -> One of the dependent facts does not exist");
            }
        }
    }