public void animateHint(GameObject scrollParameter, string scrollParameterUri) { Scroll.ScrollAssignment suitableCompletion = LatestCompletions.Find(x => x.fact.uri.Equals(scrollParameterUri)); Fact fact; if (suitableCompletion != null) { if (StageStatic.stage.factState.ContainsKey(suitableCompletion.assignment.uri)) { fact = StageStatic.stage.factState[suitableCompletion.assignment.uri]; //Animate ScrollParameter scrollParameter.GetComponentInChildren <ImageHintAnimation>().AnimationTrigger(); //Animate Fact in FactPanel AnimateExistingFactEvent.Invoke(fact); //Animate factRepresentation in game, if fact has a Representation (e.g. OnLineFact has no Representation) if (fact.Representation != null) { fact.Representation.GetComponentInChildren <MeshRendererHintAnimation>().AnimationTrigger(); } } } else if (LatestRenderedHints.Exists(x => x.Id.Equals(scrollParameterUri))) { fact = LatestRenderedHints.Find(x => x.Id.Equals(scrollParameterUri)); var factId = fact.Id; //If there is an equal existing fact -> Animate that fact AND ScrollParameter if (StageStatic.stage.factState.ContainsKey(factId)) { Fact existingFact = StageStatic.stage.factState[factId]; //Animate ScrollParameter scrollParameter.GetComponentInChildren <ImageHintAnimation>().AnimationTrigger(); //Animate Fact in FactPanel AnimateExistingFactEvent.Invoke(existingFact); //Animate factRepresentation in game if Fact has a Representation (e.g. OnLineFact has no Representation) if (existingFact.Representation != null) { existingFact.Representation.GetComponentInChildren <MeshRendererHintAnimation>().AnimationTrigger(); } } //If not -> Generate a Fact-Representation with such dependent facts else { //Animate ScrollParameter scrollParameter.GetComponentInChildren <ImageHintAnimation>().AnimationTrigger(); //Generate new FactRepresentation and animate it AnimateNonExistingFactEvent.Invoke(fact); } } }
private string prepareScrollAssignments() { Fact tempFact; List <Scroll.ScrollAssignment> assignmentList = new List <Scroll.ScrollAssignment>(); for (int i = 0; i < ParameterDisplays.Count; i++) { Scroll.ScrollAssignment listEntry = new Scroll.ScrollAssignment(); tempFact = ParameterDisplays[i].GetComponentInChildren <DropHandling>().currentFact; if (tempFact != null) { listEntry.fact = new Scroll.UriReference(this.scroll.requiredFacts[i][email protected]); listEntry.assignment = new JSONManager.OMS(tempFact.Id); assignmentList.Add(listEntry); } } Scroll.FilledScroll filledScroll = new Scroll.FilledScroll(this.scroll.@ref, assignmentList); return(Scroll.ToJSON(filledScroll)); }