예제 #1
0
        public void AfterTest()
        {
            GameServiceProvider.ClearGameServiceProvider();

            _interest  = null;
            _point     = null;
            _character = null;
        }
        public void AfterTest()
        {
            _interest.TestDestroy();

            _interest = null;

            _service = null;

            GameServiceProvider.ClearGameServiceProvider();
        }
        public void BeforeTest()
        {
            new GameObject().AddComponent <TestGameServiceProvider>().TestAwake();

            _service = new MockEventsOfInterestService();

            GameServiceProvider.CurrentInstance.AddService <IEventsOfInterestServiceInterface>(_service);

            _interest = new GameObject().AddComponent <TestEventOfInterestTriggerResponseComponent>();
            _interest.TriggerObject = new GameObject();
            _interest.TriggerObject.AddComponent <TestUnityMessageEventDispatcherComponent>().TestAwake();
            _interest.EventOfInterestNameForTrigger       = "Name";
            _interest.EventOfInterestNameForCancelTrigger = "ThisThing";
            _interest.MultiTrigger = true;

            _interest.TestStart();
        }
예제 #4
0
        public void BeforeTest()
        {
            var gameObject = new GameObject();

            gameObject.AddComponent <MockInputBinderComponent>();
            gameObject.AddComponent <MockActionStateMachineComponent>();

            _character = gameObject.AddComponent <TestCharacterComponent>();

            _point = new GameObject().AddComponent <TestPointOfInterestComponent>();
            _point.PointOfInterestEventKey = "Test Key";

            _interest = new MockEventsOfInterestService();

            new GameObject().AddComponent <TestGameServiceProvider>().TestAwake();
            GameServiceProvider.CurrentInstance.AddService <IEventsOfInterestServiceInterface>(_interest);
        }
예제 #5
0
        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;
        }