private void ApplyInstructions(string instructions) { string[] instrList = instructions.Split(','); int numCharacters; // TODO Replace this with a twineParser.IsValidInstruction() if (!Int32.TryParse(instrList[0].Substring(1), out numCharacters)) { // TODO: Handle error somehow Debug.Log("ERROR! Malformed input!"); return; } //Debug.Log ("Number characters for this scene: " + numCharacters); dialogUI.clearLoveInterests(); for (int i = 0; i < numCharacters; i++) { GameManager.LoveInterestName name = twineParser.ParseName(twineParser.TrimTag(instrList [3 * i + 1])); DialogUI.ImagePositon position = twineParser.ParsePos(twineParser.TrimTag(instrList [3 * i + 2])); LoveInterest.Emotion emotion = twineParser.ParseEmotion(twineParser.TrimTag(instrList [3 * i + 3])); dialogUI.displayLoveInterest(gameManager.getLoveInterest(name), emotion, position); } }
public void displayLoveInterest(LoveInterest loveInterest, LoveInterest.Emotion emotion, ImagePositon position = ImagePositon.Center) { loveInterestImages[(int)position].enabled = true; loveInterestImages[(int)position].sprite = loveInterest.getEmotionSprite(emotion); }