void LoadPrompt() { Vector3 Position = StartPosition; Vector3 flyerPosition = FlyingStart; foreach (char Character in options.MiniGamePrompts[CurrentPrompt]) { float xIncrement = 0.2f; if (Character != ' ') { LetterObject letter = Instantiate(LetterPrefab, Position, Quaternion.identity); MovingLetter flyer = Instantiate(MovingPrefab, flyerPosition, Quaternion.identity); flyer.Letter = letter.Letter = Character; letter.SetSprite(GetSprite(Character)); flyer.SetSprite(GetSprite(Character)); letter.Target = flyer; xIncrement = letter.Renderer.bounds.size.x; Prompt.Add(letter); Flyers.Add(flyer); } Position.x += xIncrement; flyerPosition.x += xIncrement; } }
public void generateScore() { Debug.Log("scoring!"); score = 0; currentProfile = profileTabs.getCurrentlySelectedContent().GetComponent <TaggedObject>(); currentLetter = letterTabs.getCurrentlySelectedContent().GetComponent <LetterObject>(); TaggedObject[] wordsUsed = currentLetter.getFilledWords(); Tags[] profileTags = currentProfile.getAllTags(); for (int i = 0; i < wordsUsed.Length; i++) { score += 1; if (wordsUsed[i].hasTagOverlap(profileTags)) { score += 1; } } scoreLabel.text = score.ToString(); }