//private Camera camera; void Start() { AddFactEvent.AddListener(FactAction); RemoveFactEvent.AddListener(DeleteObject); AnimateNonExistingFactEvent.AddListener(animateNonExistingFactTrigger); //Default FactRepresenation = Sphere-Prefab for Points this.FactRepresentation = Sphere; //camera = Camera.main; }
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); } } }