public void AfterTest() { _data = null; GameInstance.ClearGameInstance(); _chatter = null; GameServiceProvider.ClearGameServiceProvider(); }
public void BeforeTest() { new GameObject().AddComponent <TestGameServiceProvider>().TestAwake(); _events = new MockEventsOfInterestService(); GameServiceProvider.CurrentInstance.AddService <IEventsOfInterestServiceInterface>(_events); _chatter = new GameObject().AddComponent <TestChatterComponent>(); var input = new GameObject().AddComponent <MockInputComponent>(); input.gameObject.AddComponent <TestGameInstance>().TestAwake(); _data = ScriptableObject.CreateInstance <DialogueData>(); _data.DialogueEntries = new List <DialogueEntry> { new DialogueEntry { DialogueEntryKey = "TestKey", Lines = new List <DialogueLineEntry> { new DialogueLineEntry { DialogueKey = new LocalisationKey("TestNamespace", "TestValue"), NameKey = new LocalisationKey("TestNamespaceNameKey", "TestNameValue"), DialogueSpeed = 1.0f, Portrait = Resources.Load <Sprite>(SpritePath), TalkNoise = new AudioClip() }, new DialogueLineEntry { DialogueKey = new LocalisationKey("TestNamespace2", "TestValue2"), NameKey = new LocalisationKey("TestNamespaceNameKey2", "TestNameValue2"), DialogueSpeed = 2.0f, Portrait = Resources.Load <Sprite>(SpritePath), TalkNoise = new AudioClip() } }, Priority = 1, ChatterType = EEventOfInterestType.OneShot }, new DialogueEntry { DialogueEntryKey = "OtherTestKey", Lines = new List <DialogueLineEntry> { new DialogueLineEntry { DialogueKey = new LocalisationKey("OtherTestNamespace", "TestValue"), NameKey = new LocalisationKey("OtherTestNamespaceNameKey", "TestNameValue"), DialogueSpeed = 1.0f, Portrait = Resources.Load <Sprite>(SpritePath), TalkNoise = new AudioClip() }, new DialogueLineEntry { DialogueKey = new LocalisationKey("OtherTestNamespace2", "TestValue2"), NameKey = new LocalisationKey("OtherTestNamespaceNameKey2", "TestNameValue2"), DialogueSpeed = 2.0f, Portrait = Resources.Load <Sprite>(SpritePath), TalkNoise = new AudioClip() } }, Priority = 1, ChatterType = EEventOfInterestType.Persistant } }; _chatter.ChatterData = _data; }