public void InputtingNonNullTwineStory_SetsUpTransitionsCorrectly() { TwineStory twineStory = new TwineStory(); TwineSpeechNode twineSpeechNode = new TwineSpeechNode(); twineSpeechNode.Name = "TestName"; twineStory.Nodes.Add(twineSpeechNode); TwineSpeechNode twineSpeechNode2 = new TwineSpeechNode(); twineSpeechNode2.Name = "TestName2"; twineStory.Nodes.Add(twineSpeechNode2); TwineLink twineLink = new TwineLink("Link", "Text|TestName2"); twineSpeechNode.TwineLinks.Add(twineLink); Story story = Story.Load(twineStory); Assert.IsNotNull(story); Assert.AreEqual(2, story.NodeCount); SpeechNode speechNode = story.GetNodeAt(0); Assert.AreEqual(1, speechNode.TransitionCount); Transition transition = speechNode.GetTransitionAt(0); Assert.AreSame(speechNode, transition.Source); Assert.AreSame(story.GetNodeAt(1), transition.Destination); }
IEnumerator her_alarm(TwineLink continueLink) { SoundAlarm(); for (float t = 0; t <= alarmWakeUpDelay; t += Time.deltaTime) { her_sfxBreathing.volume = 1f - (t / alarmWakeUpDelay); yield return(null); } her_sfxBreathing.Stop(); story.Advance(continueLink); }
IEnumerator ClickForAlarm(TwineLink continueLink) { // Wait for a click, play alarm and then advance do { yield return(null); }while (!uiTextPlayer.WasClicked()); SoundAlarm(); yield return(new WaitForSeconds(alarmWakeUpDelay)); story.Advance(continueLink); }
public void Constructor_SetsDestinationName_ToCorrectValue() { TwineLink twineLink = new TwineLink("Name", "Text|Destination"); Assert.AreEqual("Destination", twineLink.DestinationName); }
public void Constructor_Default_SetsDestinationName_ToEmptyString() { TwineLink twineLink = new TwineLink(); Assert.AreEqual("", twineLink.DestinationName); }
public void Constructor_Default_SetsLinkText_ToEmptyString() { TwineLink twineLink = new TwineLink(); Assert.AreEqual("", twineLink.LinkText); }
public void Constructor_SetsName_ToInputtedValue() { TwineLink twineLink = new TwineLink("Name", "Link"); Assert.AreEqual("Name", twineLink.Name); }