diff --git a/Assets/CHANGELOG.md b/Assets/CHANGELOG.md index 40ca861..83797f5 100644 --- a/Assets/CHANGELOG.md +++ b/Assets/CHANGELOG.md @@ -1,9 +1,51 @@ # Changelog -## [1.0.0] - YYYY-MM-DD +## [0.0.4-preview.5] - 2019-08-06 -* Initial version +Refactor code ### Features -* +* Add Interval event + +### Improvements + +* Refactor codes +* Reverses reference direction between Publishers + +## [0.0.3-preview.4] - 2019-08-06 + +Fix minor bugs + +### Fixes + +* Avoid `CS0649` warning +* Fix version conflicts in UniRx + +## [0.0.2-preview.3] - 2019-08-06 + +Support many events + +### Features + +* Support Lifecycle events +* Support Physics/Physics2D events +* Support Camera, Transform, RectTransform events +* Support Audio events + +### Improvements + +* Connect events correctly +* Refresh EventMessages on re-invoke event + +### Supports + +* Supported Unity version bumped up to 2019.2 + +## [0.0.1] - 2019-07-21 + +Initial version + +### Features + +* Implements simple events diff --git a/Assets/README.md b/Assets/README.md index c42425d..501e783 100644 --- a/Assets/README.md +++ b/Assets/README.md @@ -1,13 +1,13 @@ -# Event Connector +# UniFlow -EventConnector is a library that can connect various Unity events including user interaction without writing any C# script. +UniFlow is a library that can connect various Unity components without writing any C# script. -Processes such as "Tutorial that accepts user interaction" and "Waiting for the end of playback of Animation, Audio, Timeline, etc." can be implemented easily. +You can implement easily processes such as "Tutorial that accepts user interaction" and "Waiting for the end of playback of Animation, Audio, Timeline, etc.". ## Installation ```bash -upm add package dev.monry.upm.eventconnector +upm add package dev.monry.uniflow ``` Please refer to [this repository](https://github.com/upm-packages/upm-cli) about the `upm` command. @@ -16,37 +16,38 @@ Please refer to [this repository](https://github.com/upm-packages/upm-cli) about ### Basics -#### 1. Attach EventPublishers +#### 1. Attach Connectors -Attach one or more Components what implements `IEventConnectable` listed below into GameObject. +Attach one or more Components what implements `ConnectorBase` listed below into GameObject. -#### 2. Implement EventReceiver +#### 2. Connect Connectors -Implement Component what inherits `EventReceiver`. +Set *Next `ConnectorBase`* into **Target Instances** field for each Connectors. -Implement the process you want to execute when the event is received in the `OnReceive()` method that needs to override by `EventReceiver`. +It is also possible to solve with `Zenject.ResolveIdAll()` by setting ID in **Target Ids** field -This method will be passed `EventMessages` what contains all propagated event informations. +#### 3. Implement Receiver -#### 3. Connect EventConnectors and EventReceiver +Implement Component what inherits `ReceiverBase`. -Set **Next IEventConnectable** into *Target Connector Instances* field for each EventPublisher. +Implement the process you want to execute when the event is received in the `OnReceive()` method that needs to override by `ReceiverBase`. -It is also possible to solve with `Zenject.ResolveIdAll()` by setting ID in *Target Connector Ids* field +This method will be passed `EventMessages` what contains all propagated event informations. ### Inspector inspector -#### Target Connector Instances +#### Target Instances -Specify instances what inherits `EventPublisher` or `EventReceiver` into this field. +Specify instances what inherits `ConnectableBase` into this field.
+\* `ConnectorBase` and `ReceiverBase` are inherits `ConnectableBase` Fire messages at the correct time for each component. -#### Target Connector Instances +#### Target Ids -Specify IDs what provides instances of `EventPublisher` or `EventReceiver` resolved by `Zenject.ResolveIdAll()` into this field. +Specify IDs what provides instances of `IConnectable` resolved by `Zenject.ResolveIdAll()` into this field. Fire messages at the correct time for each component. @@ -58,11 +59,11 @@ Set true to allow to act as the entry point of events. Set true to allow to act as the receiver of events. -#### Other parameters for each Publisher +#### Other parameters for each Connector Individual parameters can be specified for each component. -## Components what inherits `EventPublisher` +## Components what inherits `ConnectorBase` ### Messaging from traditional callback diff --git a/Assets/Scripts/ConnectableBase.cs b/Assets/Scripts/ConnectableBase.cs new file mode 100644 index 0000000..0047419 --- /dev/null +++ b/Assets/Scripts/ConnectableBase.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +namespace UniFlow +{ + public abstract class ConnectableBase : MonoBehaviour, IConnectable + { + } +} \ No newline at end of file diff --git a/Assets/Scripts/EventConnectable.cs.meta b/Assets/Scripts/ConnectableBase.cs.meta similarity index 100% rename from Assets/Scripts/EventConnectable.cs.meta rename to Assets/Scripts/ConnectableBase.cs.meta diff --git a/Assets/Scripts/Connector/AnimationEvent.cs b/Assets/Scripts/Connector/AnimationEvent.cs index 54f2787..06444b8 100644 --- a/Assets/Scripts/Connector/AnimationEvent.cs +++ b/Assets/Scripts/Connector/AnimationEvent.cs @@ -1,21 +1,83 @@ using System; +using System.Linq; using JetBrains.Annotations; using UniRx; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - // AnimationEvent cannot fire to Component attaching to another GameObject - [RequireComponent(typeof(Animator))] - [AddComponentMenu("Event Connector/AnimationEvent", 301)] - public class AnimationEvent : EventPublisher + [AddComponentMenu("UniFlow/AnimationEvent", 302)] + public class AnimationEvent : ConnectorBase { + [SerializeField] + [Tooltip("If you do not specify it will be used SimpleAnimation setting")] + private AnimationClip animationClip = default; + private AnimationClip AnimationClip + { + get => animationClip; + [UsedImplicitly] + set => animationClip = value; + } + + [SerializeField] private AnimatorCullingMode cullingMode = AnimatorCullingMode.AlwaysAnimate; + private AnimatorCullingMode CullingMode + { + get => cullingMode; + [UsedImplicitly] + set => cullingMode = value; + } + + [SerializeField] private AnimatorUpdateMode updateMode = AnimatorUpdateMode.Normal; + private AnimatorUpdateMode UpdateMode + { + get => updateMode; + [UsedImplicitly] + set => updateMode = value; + } + + private Animator animator = default; + private Animator Animator + { + get => + animator != default + ? animator + : animator = + GetComponent() != default + ? GetComponent() + : gameObject.AddComponent(); + [UsedImplicitly] + set => animator = value; + } + + private SimpleAnimation simpleAnimation = default; + private SimpleAnimation SimpleAnimation + { + get => + simpleAnimation != default + ? simpleAnimation + : simpleAnimation = + GetComponent() != default + ? GetComponent() + : gameObject.AddComponent() + ; + [UsedImplicitly] + set => simpleAnimation = value; + } + private ISubject Subject { get; } = new Subject(); - public override IObservable OnPublishAsObservable() => - Subject + public override IObservable OnConnectAsObservable() + { + if (AnimationClip != default && GetComponent() == default && SimpleAnimation.GetStates().All(x => x.clip != AnimationClip)) + { + SimpleAnimation.AddClip(AnimationClip, AnimationClip.GetInstanceID().ToString()); + } + + return Subject + // Prevents the previous flow from being re-invoked when triggered multiple times .Take(1) - .Select(x => EventMessage.Create(EventType.AnimationEvent, this, x)); + .Select(x => EventMessage.Create(ConnectorType.AnimationEvent, this, x)); + } /// /// Invoked from AnimationEvent @@ -26,5 +88,17 @@ public void Dispatch(UnityEngine.AnimationEvent animationEvent) { Subject.OnNext(animationEvent); } + + private void Awake() + { + // ReSharper disable once InvertIf + // Automatic add components Animator and SimpleAnimation if AudioClip specified and Animator component does not exists. + if (AnimationClip != default && Animator == default && SimpleAnimation.GetStates().All(x => x.clip != AnimationClip)) + { + SimpleAnimation.AddClip(AnimationClip, AnimationClip.GetInstanceID().ToString()); + SimpleAnimation.cullingMode = CullingMode; + Animator.updateMode = UpdateMode; + } + } } } \ No newline at end of file diff --git a/Assets/Scripts/Connector/AnimatorTrigger.cs b/Assets/Scripts/Connector/AnimatorTrigger.cs index f83399c..521fc12 100644 --- a/Assets/Scripts/Connector/AnimatorTrigger.cs +++ b/Assets/Scripts/Connector/AnimatorTrigger.cs @@ -1,34 +1,43 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/AnimatorTrigger", 300)] - public class AnimatorTrigger : EventPublisher + [AddComponentMenu("UniFlow/AnimatorTrigger", 301)] + public class AnimatorTrigger : ConnectorBase { [SerializeField] [Tooltip("If you do not specify it will be obtained by GameObject.GetComponent()")] private Animator animator = default; + private Animator Animator => animator ? animator : animator = GetComponent(); + [SerializeField] private string triggerName = default; + private string TriggerName + { + get => triggerName; + [UsedImplicitly] + set => triggerName = value; + } - private Animator Animator => animator ? animator : animator = GetComponent(); - private string TriggerName => triggerName; private int TriggerId => Animator.StringToHash(TriggerName); private IDisposable Disposable { get; } = new CompositeDisposable(); - public override IObservable OnPublishAsObservable() => - Observable + public override IObservable OnConnectAsObservable() + { + return Observable .Create( observer => { Animator.SetTrigger(TriggerId); - observer.OnNext(EventMessage.Create(EventType.AnimatorTrigger, Animator, AnimatorTriggerEventData.Create(TriggerName))); + observer.OnNext(EventMessage.Create(ConnectorType.AnimatorTrigger, Animator, AnimatorTriggerEventData.Create(TriggerName))); return Disposable; } ); + } private void OnDestroy() { diff --git a/Assets/Scripts/Connector/AudioController.cs b/Assets/Scripts/Connector/AudioController.cs index f3b928d..0c60d57 100644 --- a/Assets/Scripts/Connector/AudioController.cs +++ b/Assets/Scripts/Connector/AudioController.cs @@ -1,33 +1,68 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/AudioController", 302)] - public class AudioController : EventPublisher + [AddComponentMenu("UniFlow/AudioController", 303)] + public class AudioController : ConnectorBase { [SerializeField] private AudioControlMethod audioControlMethod = default; + private AudioControlMethod AudioControlMethod + { + get => audioControlMethod; + [UsedImplicitly] + set => audioControlMethod = value; + } + [SerializeField] - [Tooltip("If you do not specify it will be obtained by GameObject.GetComponent()")] - private AudioSource audioSource = default; + [Tooltip("If you do not specify it will be obtained by AudioSource.clip")] + private AudioClip audioClip = default; + private AudioClip AudioClip + { + get => audioClip; + [UsedImplicitly] + set => audioClip = value; + } - private AudioControlMethod AudioControlMethod => audioControlMethod; - private AudioSource AudioSource => audioSource ? audioSource : audioSource = GetComponent(); + private AudioSource audioSource = default; + private AudioSource AudioSource + { + get => + audioSource != default + ? audioSource + : audioSource = + GetComponent() != default + ? GetComponent() + : gameObject.AddComponent(); + [UsedImplicitly] + set => audioSource = value; + } private IDisposable Disposable { get; } = new CompositeDisposable(); - public override IObservable OnPublishAsObservable() => - Observable + public override IObservable OnConnectAsObservable() + { + return Observable .Create( observer => { InvokeAudioSourceMethod(); - observer.OnNext(EventMessage.Create(EventType.AudioController, AudioSource, AudioControllerEventData.Create(AudioControlMethod))); + observer.OnNext(EventMessage.Create(ConnectorType.AudioController, AudioSource, AudioControllerEventData.Create(AudioControlMethod))); return Disposable; } ); + } + + private void Awake() + { + if (AudioClip != default) + { + AudioSource.clip = AudioClip; + } + } private void InvokeAudioSourceMethod() { diff --git a/Assets/Scripts/Connector/AudioEvent.cs b/Assets/Scripts/Connector/AudioEvent.cs index d8f225b..e3c8528 100644 --- a/Assets/Scripts/Connector/AudioEvent.cs +++ b/Assets/Scripts/Connector/AudioEvent.cs @@ -1,27 +1,61 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [RequireComponent(typeof(AudioSource))] - [AddComponentMenu("Event Connector/AudioEvent", 303)] - public class AudioEvent : EventPublisher + [AddComponentMenu("UniFlow/AudioEvent", 304)] + public class AudioEvent : ConnectorBase { [SerializeField] private AudioEventType audioEventType = default; + private AudioEventType AudioEventType + { + get => audioEventType; + [UsedImplicitly] + set => audioEventType = value; + } + [SerializeField] - [Tooltip("If you do not specify it will be obtained by GameObject.GetComponent()")] - private AudioSource audioSource = default; + [Tooltip("If you do not specify it will be obtained by AudioSource.clip")] + private AudioClip audioClip = default; + private AudioClip AudioClip + { + get => audioClip; + [UsedImplicitly] + set => audioClip = value; + } - private AudioEventType AudioEventType => audioEventType; - private AudioSource AudioSource => audioSource ? audioSource : audioSource = GetComponent(); + private AudioSource audioSource = default; + private AudioSource AudioSource + { + get => + audioSource != default + ? audioSource + : audioSource = + GetComponent() != default + ? GetComponent() + : gameObject.AddComponent(); + [UsedImplicitly] + set => audioSource = value; + } private IReadOnlyReactiveProperty> TimePair { get; set; } - public override IObservable OnPublishAsObservable() => - OnAudioEventAsObservable() - .Select(x => EventMessage.Create(EventType.AudioEvent, AudioSource, AudioEventData.Create(x))); + public override IObservable OnConnectAsObservable() + { + return OnAudioEventAsObservable() + .Select(x => EventMessage.Create(ConnectorType.AudioEvent, AudioSource, AudioEventData.Create(x))); + } + + private void Awake() + { + if (AudioClip != default) + { + AudioSource.clip = AudioClip; + } + } private IObservable OnAudioEventAsObservable() { @@ -48,9 +82,9 @@ private IObservable OnAudioEventAsObservable() } } - private AudioEventType DetectAudioEventType(bool isPlaying, AudioClip audioClip) + private AudioEventType DetectAudioEventType(bool isPlaying, AudioClip clip) { - if (audioClip == default) + if (clip == default) { throw new ArgumentOutOfRangeException(); } @@ -60,7 +94,7 @@ private AudioEventType DetectAudioEventType(bool isPlaying, AudioClip audioClip) return AudioEventType.Play; } - if (!isPlaying && (Mathf.Approximately(audioClip.length, TimePair.Value.Current) || Mathf.Approximately(0.0f, TimePair.Value.Current) && TimePair.Value.Previous > 0.0f)) + if (!isPlaying && (Mathf.Approximately(clip.length, TimePair.Value.Current) || Mathf.Approximately(0.0f, TimePair.Value.Current) && TimePair.Value.Previous > 0.0f)) { return AudioEventType.Stop; } diff --git a/Assets/Scripts/Connector/CameraEvent.cs b/Assets/Scripts/Connector/CameraEvent.cs index c147688..15afd5e 100644 --- a/Assets/Scripts/Connector/CameraEvent.cs +++ b/Assets/Scripts/Connector/CameraEvent.cs @@ -1,25 +1,36 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UniRx.Triggers; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/CameraEvent", 104)] - public class CameraEvent : EventPublisher + [AddComponentMenu("UniFlow/CameraEvent", 104)] + public class CameraEvent : ConnectorBase { [SerializeField] private CameraEventType cameraEventType = default; - [SerializeField] - [Tooltip("If you do not specify it will be used self instance")] - private Component component = default; + private CameraEventType CameraEventType + { + get => cameraEventType; + [UsedImplicitly] + set => cameraEventType = value; + } - private CameraEventType CameraEventType => cameraEventType; - private Component Component => component ? component : component = this; + private Component component = default; + private Component Component + { + get => component ? component : component = this; + [UsedImplicitly] + set => component = value; + } - public override IObservable OnPublishAsObservable() => - OnEventAsObservable() - .Select(_ => EventMessage.Create(EventType.CameraEvent, Component, CameraEventData.Create(CameraEventType))); + public override IObservable OnConnectAsObservable() + { + return OnEventAsObservable() + .Select(_ => EventMessage.Create(ConnectorType.CameraEvent, Component, CameraEventData.Create(CameraEventType))); + } private IObservable OnEventAsObservable() { diff --git a/Assets/Scripts/Connector/Empty.cs b/Assets/Scripts/Connector/Empty.cs index 0daf301..0b06f4c 100644 --- a/Assets/Scripts/Connector/Empty.cs +++ b/Assets/Scripts/Connector/Empty.cs @@ -2,12 +2,12 @@ using UniRx; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/Empty", 10000)] - public class Empty : EventPublisher + [AddComponentMenu("UniFlow/Empty", 10000)] + public class Empty : ConnectorBase { - public override IObservable OnPublishAsObservable() => - Observable.Return(EventMessage.Create(EventType.Empty, this)); + public override IObservable OnConnectAsObservable() => + Observable.Return(EventMessage.Create(ConnectorType.Empty, this)); } } \ No newline at end of file diff --git a/Assets/Scripts/Connector/Interval.cs b/Assets/Scripts/Connector/Interval.cs index fc714e7..0201228 100644 --- a/Assets/Scripts/Connector/Interval.cs +++ b/Assets/Scripts/Connector/Interval.cs @@ -1,18 +1,26 @@ using System; +using JetBrains.Annotations; using UniRx; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/Interval", 9001)] - public class Interval : EventPublisher + [AddComponentMenu("UniFlow/Interval", 9001)] + public class Interval : ConnectorBase { [SerializeField] private float seconds = default; - private float Seconds => seconds; + private float Seconds + { + get => seconds; + [UsedImplicitly] + set => seconds = value; + } - public override IObservable OnPublishAsObservable() => - Observable + public override IObservable OnConnectAsObservable() + { + return Observable .Interval(TimeSpan.FromSeconds(Seconds)) - .Select(_ => EventMessage.Create(EventType.Interval, this, Seconds)); + .Select(_ => EventMessage.Create(ConnectorType.Interval, this, Seconds)); + } } } \ No newline at end of file diff --git a/Assets/Scripts/Connector/LifecycleEvent.cs b/Assets/Scripts/Connector/LifecycleEvent.cs index d5f1be5..196b8b6 100644 --- a/Assets/Scripts/Connector/LifecycleEvent.cs +++ b/Assets/Scripts/Connector/LifecycleEvent.cs @@ -1,28 +1,39 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UniRx.Triggers; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/LifecycleEvent", 100)] - public class LifecycleEvent : EventPublisher + [AddComponentMenu("UniFlow/LifecycleEvent", 100)] + public class LifecycleEvent : ConnectorBase { [SerializeField] private LifecycleEventType lifecycleEventType = default; - [SerializeField] - [Tooltip("If you do not specify it will be used self instance")] - private Component component = default; + private LifecycleEventType LifecycleEventType + { + get => lifecycleEventType; + [UsedImplicitly] + set => lifecycleEventType = value; + } - private LifecycleEventType LifecycleEventType => lifecycleEventType; - private Component Component => component ? component : component = this; + private Component component = default; + private Component Component + { + get => component ? component : component = this; + [UsedImplicitly] + set => component = value; + } private IReactiveProperty StartProperty { get; } = new BoolReactiveProperty(false); private IReactiveProperty OnEnableProperty { get; } = new BoolReactiveProperty(false); - public override IObservable OnPublishAsObservable() => - OnEventAsObservable() - .Select(_ => EventMessage.Create(EventType.LifecycleEvent, Component, LifecycleEventData.Create(LifecycleEventType))); + public override IObservable OnConnectAsObservable() + { + return OnEventAsObservable() + .Select(_ => EventMessage.Create(ConnectorType.LifecycleEvent, Component, LifecycleEventData.Create(LifecycleEventType))); + } private void Awake() { diff --git a/Assets/Scripts/Connector/LoadSceneEvent.cs b/Assets/Scripts/Connector/LoadSceneEvent.cs new file mode 100644 index 0000000..280af64 --- /dev/null +++ b/Assets/Scripts/Connector/LoadSceneEvent.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using JetBrains.Annotations; +using UniRx; +using UniRx.Async; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace UniFlow.Connector +{ + [AddComponentMenu("UniFlow/LoadScene", 400)] + public class LoadSceneEvent : ConnectorBase + { + [SerializeField] private List sceneNames = default; + private IEnumerable SceneNames + { + get => sceneNames; + [UsedImplicitly] + set => sceneNames = value.ToList(); + } + + public override IObservable OnConnectAsObservable() + { + return LoadScenes() + .ToObservable() + .Select(_ => EventMessage.Create(ConnectorType.LoadScene, this, SceneNames)); + } + + private async UniTask LoadScenes() + { + foreach (var sceneName in SceneNames) + { + await SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive); + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Connector/LoadSceneEvent.cs.meta b/Assets/Scripts/Connector/LoadSceneEvent.cs.meta new file mode 100644 index 0000000..c53112a --- /dev/null +++ b/Assets/Scripts/Connector/LoadSceneEvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 28abb11fbf954db080cb858d39c542f7 +timeCreated: 1565249834 \ No newline at end of file diff --git a/Assets/Scripts/Connector/MouseEvent.cs b/Assets/Scripts/Connector/MouseEvent.cs index 72450ab..9a14e7c 100644 --- a/Assets/Scripts/Connector/MouseEvent.cs +++ b/Assets/Scripts/Connector/MouseEvent.cs @@ -1,25 +1,34 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UniRx.Triggers; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/MouseEvent", 106)] - public class MouseEvent : EventPublisher + [AddComponentMenu("UniFlow/MouseEvent", 106)] + public class MouseEvent : ConnectorBase { [SerializeField] private MouseEventType mouseEventType = default; - [SerializeField] - [Tooltip("If you do not specify it will be used self instance")] - private Component component = default; + private MouseEventType MouseEventType + { + get => mouseEventType; + [UsedImplicitly] + set => mouseEventType = value; + } - private MouseEventType MouseEventType => mouseEventType; - private Component Component => component ? component : component = this; + private Component component = default; + private Component Component + { + get => component ? component : component = this; + [UsedImplicitly] + set => component = value; + } - public override IObservable OnPublishAsObservable() => + public override IObservable OnConnectAsObservable() => OnEventAsObservable() - .Select(_ => EventMessage.Create(EventType.MouseEvent, Component, MouseEventData.Create(MouseEventType))); + .Select(_ => EventMessage.Create(ConnectorType.MouseEvent, Component, MouseEventData.Create(MouseEventType))); private IObservable OnEventAsObservable() { diff --git a/Assets/Scripts/Connector/ParticleEvent.cs b/Assets/Scripts/Connector/ParticleEvent.cs index f7ed672..1f0f4f6 100644 --- a/Assets/Scripts/Connector/ParticleEvent.cs +++ b/Assets/Scripts/Connector/ParticleEvent.cs @@ -1,25 +1,34 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UniRx.Triggers; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/ParticleEvent", 105)] - public class ParticleEvent : EventPublisher + [AddComponentMenu("UniFlow/ParticleEvent", 105)] + public class ParticleEvent : ConnectorBase { [SerializeField] private ParticleEventType particleEventType = default; - [SerializeField] - [Tooltip("If you do not specify it will be used self instance")] - private Component component = default; + private ParticleEventType ParticleEventType + { + get => particleEventType; + [UsedImplicitly] + set => particleEventType = value; + } - private ParticleEventType ParticleEventType => particleEventType; - private Component Component => component ? component : component = this; + private Component component = default; + private Component Component + { + get => component ? component : component = this; + [UsedImplicitly] + set => component = value; + } - public override IObservable OnPublishAsObservable() => + public override IObservable OnConnectAsObservable() => OnEventAsObservable() - .Select(x => EventMessage.Create(EventType.ParticleEvent, Component, ParticleEventData.Create(ParticleEventType, x))); + .Select(x => EventMessage.Create(ConnectorType.ParticleEvent, Component, ParticleEventData.Create(ParticleEventType, x))); private IObservable OnEventAsObservable() { diff --git a/Assets/Scripts/Connector/PhysicsCollision2DEvent.cs b/Assets/Scripts/Connector/PhysicsCollision2DEvent.cs index 74cdfc4..97189fe 100644 --- a/Assets/Scripts/Connector/PhysicsCollision2DEvent.cs +++ b/Assets/Scripts/Connector/PhysicsCollision2DEvent.cs @@ -1,25 +1,34 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UniRx.Triggers; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/PhyticsCollision2DEvent", 201)] - public class PhysicsCollision2DEvent : EventPublisher + [AddComponentMenu("UniFlow/PhyticsCollision2DEvent", 201)] + public class PhysicsCollision2DEvent : ConnectorBase { [SerializeField] private PhysicsCollision2DEventType physicsCollision2DEventType = default; - [SerializeField] - [Tooltip("If you do not specify it will be used self instance")] - private Component component = default; + private PhysicsCollision2DEventType PhysicsCollision2DEventType + { + get => physicsCollision2DEventType; + [UsedImplicitly] + set => physicsCollision2DEventType = value; + } - private PhysicsCollision2DEventType PhysicsCollision2DEventType => physicsCollision2DEventType; - private Component Component => component ? component : component = this; + private Component component = default; + private Component Component + { + get => component ? component : component = this; + [UsedImplicitly] + set => component = value; + } - public override IObservable OnPublishAsObservable() => + public override IObservable OnConnectAsObservable() => OnEventAsObservable() - .Select(x => EventMessage.Create(EventType.PhysicsCollision2DEvent, Component, PhysicsCollision2DEventData.Create(PhysicsCollision2DEventType, x))); + .Select(x => EventMessage.Create(ConnectorType.PhysicsCollision2DEvent, Component, PhysicsCollision2DEventData.Create(PhysicsCollision2DEventType, x))); private IObservable OnEventAsObservable() { diff --git a/Assets/Scripts/Connector/PhysicsCollisionEvent.cs b/Assets/Scripts/Connector/PhysicsCollisionEvent.cs index 8e2b8de..b53a1cf 100644 --- a/Assets/Scripts/Connector/PhysicsCollisionEvent.cs +++ b/Assets/Scripts/Connector/PhysicsCollisionEvent.cs @@ -1,25 +1,34 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UniRx.Triggers; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/PhysicsCollisionEvent", 200)] - public class PhysicsCollisionEvent : EventPublisher + [AddComponentMenu("UniFlow/PhysicsCollisionEvent", 200)] + public class PhysicsCollisionEvent : ConnectorBase { [SerializeField] private PhysicsCollisionEventType physicsCollisionEventType = default; - [SerializeField] - [Tooltip("If you do not specify it will be used self instance")] - private Component component = default; + private PhysicsCollisionEventType PhysicsCollisionEventType + { + get => physicsCollisionEventType; + [UsedImplicitly] + set => physicsCollisionEventType = value; + } - private PhysicsCollisionEventType PhysicsCollisionEventType => physicsCollisionEventType; - private Component Component => component ? component : component = this; + private Component component = default; + private Component Component + { + get => component ? component : component = this; + [UsedImplicitly] + set => component = value; + } - public override IObservable OnPublishAsObservable() => + public override IObservable OnConnectAsObservable() => OnEventAsObservable() - .Select(x => EventMessage.Create(EventType.PhysicsCollisionEvent, Component, PhysicsCollisionEventData.Create(PhysicsCollisionEventType, x))); + .Select(x => EventMessage.Create(ConnectorType.PhysicsCollisionEvent, Component, PhysicsCollisionEventData.Create(PhysicsCollisionEventType, x))); private IObservable OnEventAsObservable() { diff --git a/Assets/Scripts/Connector/PhysicsTrigger2DEvent.cs b/Assets/Scripts/Connector/PhysicsTrigger2DEvent.cs index 29b1755..c27166e 100644 --- a/Assets/Scripts/Connector/PhysicsTrigger2DEvent.cs +++ b/Assets/Scripts/Connector/PhysicsTrigger2DEvent.cs @@ -1,25 +1,36 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UniRx.Triggers; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/PhysicsTrigger2DEvent", 203)] - public class PhysicsTrigger2DEvent : EventPublisher + [AddComponentMenu("UniFlow/PhysicsTrigger2DEvent", 203)] + public class PhysicsTrigger2DEvent : ConnectorBase { [SerializeField] private PhysicsTrigger2DEventType physicsTrigger2DEventType = default; - [SerializeField] - [Tooltip("If you do not specify it will be used self instance")] - private Component component = default; + private PhysicsTrigger2DEventType PhysicsTrigger2DEventType + { + get => physicsTrigger2DEventType; + [UsedImplicitly] + set => physicsTrigger2DEventType = value; + } - private PhysicsTrigger2DEventType PhysicsTrigger2DEventType => physicsTrigger2DEventType; - private Component Component => component ? component : component = this; + private Component component = default; + private Component Component + { + get => component ? component : component = this; + [UsedImplicitly] + set => component = value; + } - public override IObservable OnPublishAsObservable() => - OnEventAsObservable() - .Select(x => EventMessage.Create(EventType.PhysicsTrigger2DEvent, Component, PhysicsTrigger2DEventData.Create(PhysicsTrigger2DEventType, x))); + public override IObservable OnConnectAsObservable() + { + return OnEventAsObservable() + .Select(x => EventMessage.Create(ConnectorType.PhysicsTrigger2DEvent, Component, PhysicsTrigger2DEventData.Create(PhysicsTrigger2DEventType, x))); + } private IObservable OnEventAsObservable() { diff --git a/Assets/Scripts/Connector/PhysicsTriggerEvent.cs b/Assets/Scripts/Connector/PhysicsTriggerEvent.cs index d2d8acd..d3dbc27 100644 --- a/Assets/Scripts/Connector/PhysicsTriggerEvent.cs +++ b/Assets/Scripts/Connector/PhysicsTriggerEvent.cs @@ -1,25 +1,36 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UniRx.Triggers; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/PhyticsTriggerEvent", 202)] - public class PhysicsTriggerEvent : EventPublisher + [AddComponentMenu("UniFlow/PhyticsTriggerEvent", 202)] + public class PhysicsTriggerEvent : ConnectorBase { [SerializeField] private PhysicsTriggerEventType physicsTriggerEventType = default; - [SerializeField] - [Tooltip("If you do not specify it will be used self instance")] - private Component component = default; + private PhysicsTriggerEventType PhysicsTriggerEventType + { + get => physicsTriggerEventType; + [UsedImplicitly] + set => physicsTriggerEventType = value; + } - private PhysicsTriggerEventType PhysicsTriggerEventType => physicsTriggerEventType; - private Component Component => component ? component : component = this; + private Component component = default; + private Component Component + { + get => component ? component : component = this; + [UsedImplicitly] + set => component = value; + } - public override IObservable OnPublishAsObservable() => - OnEventAsObservable() - .Select(x => EventMessage.Create(EventType.PhysicsTriggerEvent, Component, PhysicsTriggerEventData.Create(PhysicsTriggerEventType, x))); + public override IObservable OnConnectAsObservable() + { + return OnEventAsObservable() + .Select(x => EventMessage.Create(ConnectorType.PhysicsTriggerEvent, Component, PhysicsTriggerEventData.Create(PhysicsTriggerEventType, x))); + } private IObservable OnEventAsObservable() { diff --git a/Assets/Scripts/Connector/PlayableController.cs b/Assets/Scripts/Connector/PlayableController.cs index 028a0ff..667f6f1 100644 --- a/Assets/Scripts/Connector/PlayableController.cs +++ b/Assets/Scripts/Connector/PlayableController.cs @@ -1,35 +1,98 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UnityEngine; using UnityEngine.Playables; +using UnityEngine.Timeline; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/PlayableController", 304)] - public class PlayableController : EventPublisher + [AddComponentMenu("UniFlow/PlayableController", 305)] + public class PlayableController : ConnectorBase { - [SerializeField] - [Tooltip("If you do not specify it will be obtained by GameObject.GetComponent()")] + [SerializeField] private PlayableControlMethod playableControlMethod = default; + private PlayableControlMethod PlayableControlMethod + { + get => playableControlMethod; + [UsedImplicitly] + set => playableControlMethod = value; + } + + [SerializeField] private TimelineAsset timelineAsset = default; + private TimelineAsset TimelineAsset + { + get => timelineAsset; + [UsedImplicitly] + set => timelineAsset = value; + } + private PlayableDirector playableDirector = default; - private PlayableDirector PlayableDirector => playableDirector ? playableDirector : playableDirector = GetComponent(); + private PlayableDirector PlayableDirector + { + get => + playableDirector != default + ? playableDirector + : playableDirector = + GetComponent() != default + ? GetComponent() + : gameObject.AddComponent(); + [UsedImplicitly] + set => playableDirector = value; + } private IDisposable Disposable { get; } = new CompositeDisposable(); - public override IObservable OnPublishAsObservable() => - Observable + public override IObservable OnConnectAsObservable() + { + return Observable .Create( observer => { - PlayableDirector.Play(); - observer.OnNext(EventMessage.Create(EventType.PlayableController, PlayableDirector, PlayableControllerEventData.Create())); + InvokePlayableDirectorMethod(); + observer.OnNext(EventMessage.Create(ConnectorType.PlayableController, PlayableDirector, PlayableControllerEventData.Create(PlayableControlMethod))); return Disposable; } ); + } + + private void InvokePlayableDirectorMethod() + { + if (TimelineAsset != default) + { + PlayableDirector.playableAsset = TimelineAsset; + } + + switch (PlayableControlMethod) + { + case PlayableControlMethod.Play: + PlayableDirector.Play(); + break; + case PlayableControlMethod.Stop: + PlayableDirector.Stop(); + break; + case PlayableControlMethod.Pause: + PlayableDirector.Pause(); + break; + case PlayableControlMethod.Resume: + PlayableDirector.Resume(); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } private void OnDestroy() { Disposable.Dispose(); } } + + public enum PlayableControlMethod + { + Play, + Stop, + Pause, + Resume, + } } \ No newline at end of file diff --git a/Assets/Scripts/Connector/RectTransformEvent.cs b/Assets/Scripts/Connector/RectTransformEvent.cs index 54561b4..ec1c3fa 100644 --- a/Assets/Scripts/Connector/RectTransformEvent.cs +++ b/Assets/Scripts/Connector/RectTransformEvent.cs @@ -1,25 +1,36 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UniRx.Triggers; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/RectTransformEvent", 103)] - public class RectTransformEvent : EventPublisher + [AddComponentMenu("UniFlow/RectTransformEvent", 103)] + public class RectTransformEvent : ConnectorBase { [SerializeField] private RectTransformEventType rectTransformEventType = default; - [SerializeField] - [Tooltip("If you do not specify it will be used self instance")] - private Component component = default; + private RectTransformEventType RectTransformEventType + { + get => rectTransformEventType; + [UsedImplicitly] + set => rectTransformEventType = value; + } - private RectTransformEventType RectTransformEventType => rectTransformEventType; - private Component Component => component ? component : component = this; + private Component component = default; + private Component Component + { + get => component ? component : component = this; + [UsedImplicitly] + set => component = value; + } - public override IObservable OnPublishAsObservable() => - OnEventAsObservable() - .Select(_ => EventMessage.Create(EventType.RectTransformEvent, Component, RectTransformEventData.Create(RectTransformEventType))); + public override IObservable OnConnectAsObservable() + { + return OnEventAsObservable() + .Select(_ => EventMessage.Create(ConnectorType.RectTransformEvent, Component, RectTransformEventData.Create(RectTransformEventType))); + } private IObservable OnEventAsObservable() { diff --git a/Assets/Scripts/Connector/SimpleAnimationController.cs b/Assets/Scripts/Connector/SimpleAnimationController.cs new file mode 100644 index 0000000..7f0cd23 --- /dev/null +++ b/Assets/Scripts/Connector/SimpleAnimationController.cs @@ -0,0 +1,145 @@ +using System; +using System.Linq; +using JetBrains.Annotations; +using UniFlow.Message; +using UniRx; +using UnityEngine; + +namespace UniFlow.Connector +{ + [AddComponentMenu("UniFlow/SimpleAnimationController", 300)] + public class SimpleAnimationController : ConnectorBase + { + [SerializeField] private SimpleAnimationControlMethod simpleAnimationControlMethod = default; + private SimpleAnimationControlMethod SimpleAnimationControlMethod + { + get => simpleAnimationControlMethod; + [UsedImplicitly] + set => simpleAnimationControlMethod = value; + } + + [SerializeField] + [Tooltip("If you do not specify it will be used SimpleAnimation setting")] + private AnimationClip animationClip = default; + private AnimationClip AnimationClip + { + get => animationClip; + [UsedImplicitly] + set => animationClip = value; + } + + [SerializeField] private AnimatorCullingMode cullingMode = AnimatorCullingMode.AlwaysAnimate; + private AnimatorCullingMode CullingMode + { + get => cullingMode; + [UsedImplicitly] + set => cullingMode = value; + } + + [SerializeField] private AnimatorUpdateMode updateMode = AnimatorUpdateMode.Normal; + private AnimatorUpdateMode UpdateMode + { + get => updateMode; + [UsedImplicitly] + set => updateMode = value; + } + + private Animator animator = default; + private Animator Animator + { + get => + animator != default + ? animator + : animator = + GetComponent() != default + ? GetComponent() + : gameObject.AddComponent(); + [UsedImplicitly] + set => animator = value; + } + + private SimpleAnimation simpleAnimation = default; + private SimpleAnimation SimpleAnimation + { + get => + simpleAnimation != default + ? simpleAnimation + : simpleAnimation = + GetComponent() != default + ? GetComponent() + : gameObject.AddComponent() + ; + [UsedImplicitly] + set => simpleAnimation = value; + } + + private IDisposable Disposable { get; } = new CompositeDisposable(); + + public override IObservable OnConnectAsObservable() + { + return Observable + .Create( + observer => + { + InvokeSimpleAnimationMethod(); + observer.OnNext(EventMessage.Create(ConnectorType.SimpleAnimationController, SimpleAnimation, SimpleAnimationControllerEventData.Create(SimpleAnimationControlMethod))); + return Disposable; + } + ); + } + + private void Awake() + { + // ReSharper disable once InvertIf + // Automatic add components Animator and SimpleAnimation if AudioClip specified and Animator component does not exists. + if (AnimationClip != default && Animator == default && SimpleAnimation.GetStates().All(x => x.clip != AnimationClip)) + { + SimpleAnimation.AddClip(AnimationClip, AnimationClip.GetInstanceID().ToString()); + SimpleAnimation.cullingMode = CullingMode; + Animator.updateMode = UpdateMode; + } + } + + private void InvokeSimpleAnimationMethod() + { + switch (SimpleAnimationControlMethod) + { + case SimpleAnimationControlMethod.Play: + if (AnimationClip == default) + { + SimpleAnimation.Rewind(); + SimpleAnimation.Play(); + } + else + { + SimpleAnimation.Rewind(AnimationClip.GetInstanceID().ToString()); + SimpleAnimation.Play(AnimationClip.GetInstanceID().ToString()); + } + break; + case SimpleAnimationControlMethod.Stop: + if (AnimationClip == default) + { + SimpleAnimation.Stop(); + } + else + { + SimpleAnimation.Stop(AnimationClip.GetInstanceID().ToString()); + } + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + private void OnDestroy() + { + Disposable.Dispose(); + } + } + + public enum SimpleAnimationControlMethod + { + Play, + Stop, + } +} \ No newline at end of file diff --git a/Assets/Scripts/Connector/SimpleAnimationController.cs.meta b/Assets/Scripts/Connector/SimpleAnimationController.cs.meta new file mode 100644 index 0000000..86f36ec --- /dev/null +++ b/Assets/Scripts/Connector/SimpleAnimationController.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e354102254874aecbac12539fc4505b3 +timeCreated: 1565255438 \ No newline at end of file diff --git a/Assets/Scripts/Connector/TimelineSignal.cs b/Assets/Scripts/Connector/TimelineSignal.cs index cdb453d..64687a5 100644 --- a/Assets/Scripts/Connector/TimelineSignal.cs +++ b/Assets/Scripts/Connector/TimelineSignal.cs @@ -1,23 +1,26 @@ using System; -using EventConnector.Message; using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UnityEngine; using Object = UnityEngine.Object; -namespace EventConnector.Connector +namespace UniFlow.Connector { // Timeline SignalReceiver cannot serialize [Serializable] class // So I provide overloads to construct TimelineEventData - [AddComponentMenu("Event Connector/TimelineSignal", 305)] - public class TimelineSignal : EventPublisher + [AddComponentMenu("UniFlow/TimelineSignal", 306)] + public class TimelineSignal : ConnectorBase { private ISubject Subject { get; } = new Subject(); - public override IObservable OnPublishAsObservable() => - Subject + public override IObservable OnConnectAsObservable() + { + return Subject + // Prevents the previous flow from being re-invoked when triggered multiple times .Take(1) - .Select(x => EventMessage.Create(EventType.TimelineSignal, this, x)); + .Select(x => EventMessage.Create(ConnectorType.TimelineSignal, this, x)); + } [UsedImplicitly] public void Dispatch() diff --git a/Assets/Scripts/Connector/Timer.cs b/Assets/Scripts/Connector/Timer.cs index bb88485..cba42cb 100644 --- a/Assets/Scripts/Connector/Timer.cs +++ b/Assets/Scripts/Connector/Timer.cs @@ -1,18 +1,26 @@ using System; +using JetBrains.Annotations; using UniRx; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/Timer", 9000)] - public class Timer : EventPublisher + [AddComponentMenu("UniFlow/Timer", 9000)] + public class Timer : ConnectorBase { [SerializeField] private float seconds = default; - private float Seconds => seconds; + private float Seconds + { + get => seconds; + [UsedImplicitly] + set => seconds = value; + } - public override IObservable OnPublishAsObservable() => - Observable + public override IObservable OnConnectAsObservable() + { + return Observable .Timer(TimeSpan.FromSeconds(Seconds)) - .Select(_ => EventMessage.Create(EventType.Timer, this, Seconds)); + .Select(_ => EventMessage.Create(ConnectorType.Timer, this, Seconds)); + } } } \ No newline at end of file diff --git a/Assets/Scripts/Connector/TransformEvent.cs b/Assets/Scripts/Connector/TransformEvent.cs index 9e590a2..cbbb459 100644 --- a/Assets/Scripts/Connector/TransformEvent.cs +++ b/Assets/Scripts/Connector/TransformEvent.cs @@ -1,25 +1,36 @@ using System; -using EventConnector.Message; +using JetBrains.Annotations; +using UniFlow.Message; using UniRx; using UniRx.Triggers; using UnityEngine; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/TransformEvent", 102)] - public class TransformEvent : EventPublisher + [AddComponentMenu("UniFlow/TransformEvent", 102)] + public class TransformEvent : ConnectorBase { [SerializeField] private TransformEventType transformEventType = default; - [SerializeField] - [Tooltip("If you do not specify it will be used self instance")] - private Component component = default; + private TransformEventType TransformEventType + { + get => transformEventType; + [UsedImplicitly] + set => transformEventType = value; + } - private TransformEventType TransformEventType => transformEventType; - private Component Component => component ? component : component = this; + private Component component = default; + private Component Component + { + get => component ? component : component = this; + [UsedImplicitly] + set => component = value; + } - public override IObservable OnPublishAsObservable() => - OnEventAsObservable() - .Select(_ => EventMessage.Create(EventType.TransformEvent, Component, TransformEventData.Create(TransformEventType))); + public override IObservable OnConnectAsObservable() + { + return OnEventAsObservable() + .Select(_ => EventMessage.Create(ConnectorType.TransformEvent, Component, TransformEventData.Create(TransformEventType))); + } private IObservable OnEventAsObservable() { diff --git a/Assets/Scripts/Connector/UIBehaviourEventTrigger.cs b/Assets/Scripts/Connector/UIBehaviourEventTrigger.cs index dc0cc25..d13e0ac 100644 --- a/Assets/Scripts/Connector/UIBehaviourEventTrigger.cs +++ b/Assets/Scripts/Connector/UIBehaviourEventTrigger.cs @@ -1,25 +1,36 @@ using System; +using JetBrains.Annotations; using UniRx; using UniRx.Triggers; using UnityEngine; using UnityEngine.EventSystems; -namespace EventConnector.Connector +namespace UniFlow.Connector { - [AddComponentMenu("Event Connector/UIBehaviourEventTrigger", 101)] - public class UIBehaviourEventTrigger : EventPublisher + [AddComponentMenu("UniFlow/UIBehaviourEventTrigger", 101)] + public class UIBehaviourEventTrigger : ConnectorBase { [SerializeField] private EventTriggerType eventTriggerType = default; - private EventTriggerType EventTriggerType => eventTriggerType; + private EventTriggerType EventTriggerType + { + get => eventTriggerType; + [UsedImplicitly] + set => eventTriggerType = value; + } - [SerializeField] - [Tooltip("If you do not specify it will be obtained by GameObject.GetComponent()")] private UIBehaviour uiBehaviour = default; - private UIBehaviour UIBehaviour => uiBehaviour ? uiBehaviour : uiBehaviour = GetComponent(); + private UIBehaviour UIBehaviour + { + get => uiBehaviour ? uiBehaviour : uiBehaviour = GetComponent(); + [UsedImplicitly] + set => uiBehaviour = value; + } - public override IObservable OnPublishAsObservable() => - OnEventTriggerAsObservable() - .Select(x => EventMessage.Create(EventType.UIBehaviourEventTrigger, UIBehaviour, x)); + public override IObservable OnConnectAsObservable() + { + return OnEventTriggerAsObservable() + .Select(x => EventMessage.Create(ConnectorType.UIBehaviourEventTrigger, UIBehaviour, x)); + } private IObservable OnEventTriggerAsObservable() { diff --git a/Assets/Scripts/Connector/UnloadSceneEvent.cs b/Assets/Scripts/Connector/UnloadSceneEvent.cs new file mode 100644 index 0000000..fc433e6 --- /dev/null +++ b/Assets/Scripts/Connector/UnloadSceneEvent.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using JetBrains.Annotations; +using UniRx; +using UniRx.Async; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace UniFlow.Connector +{ + [AddComponentMenu("UniFlow/UnloadScene", 401)] + public class UnloadSceneEvent : ConnectorBase + { + [SerializeField] private List sceneNames = default; + private IEnumerable SceneNames + { + get => sceneNames; + [UsedImplicitly] + set => sceneNames = value.ToList(); + } + + public override IObservable OnConnectAsObservable() + { + return UnloadScenes() + .ToObservable() + .Select(_ => EventMessage.Create(ConnectorType.UnloadScene, this, SceneNames)); + } + + private async UniTask UnloadScenes() + { + foreach (var sceneName in SceneNames) + { + await SceneManager.UnloadSceneAsync(sceneName); + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Connector/UnloadSceneEvent.cs.meta b/Assets/Scripts/Connector/UnloadSceneEvent.cs.meta new file mode 100644 index 0000000..7be582e --- /dev/null +++ b/Assets/Scripts/Connector/UnloadSceneEvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0a8555d88fa64fae816f0116869b471d +timeCreated: 1565249848 \ No newline at end of file diff --git a/Assets/Scripts/EventPublisher.cs b/Assets/Scripts/ConnectorBase.cs similarity index 58% rename from Assets/Scripts/EventPublisher.cs rename to Assets/Scripts/ConnectorBase.cs index 8a06daf..717e9cd 100644 --- a/Assets/Scripts/EventPublisher.cs +++ b/Assets/Scripts/ConnectorBase.cs @@ -5,15 +5,15 @@ using UnityEngine; using Zenject; -namespace EventConnector +namespace UniFlow { - public abstract class EventPublisher : EventConnectable, IEventPublisher + public abstract class ConnectorBase : ConnectableBase, IConnector { [SerializeField] [Tooltip("Specify instances of IEventConnectable directly")] - private List targetConnectorInstances = default; + private List targetComponents = default; [SerializeField] [Tooltip("Specify identifiers of IEventConnectable that resolve from Zenject.DiContainer")] - private List targetConnectorIds = default; + private List targetIds = default; [SerializeField] [Tooltip("Set true to allow to act as the entry point of events")] private bool actAsTrigger = false; @@ -21,10 +21,10 @@ [SerializeField] [Tooltip("Set true to allow to act as the entry point of events [SerializeField] [Tooltip("Set true to allow to act as the receiver")] private bool actAsReceiver = false; - private IEnumerable TargetConnectors => - new List() - .Concat(targetConnectorInstances ?? new List()) - .Concat((targetConnectorIds ?? new List()).SelectMany(Container.ResolveIdAll)) + private IEnumerable TargetConnectors => + new List() + .Concat(targetComponents ?? new List()) + .Concat((targetIds ?? new List()).SelectMany(x => Container?.ResolveIdAll(x))) .Where(x => !ReferenceEquals(x, this)) .ToArray(); @@ -36,24 +36,24 @@ protected virtual void Start() { if (ActAsTrigger) { - ((IEventPublisher) this).Connect(Observable.Return(default)); + ((IConnector) this).Connect(Observable.Return(default)); } } - void IEventPublisher.Connect(IObservable source) + void IConnector.Connect(IObservable source) { var observable = source .SelectMany( - eventMessages => (this as IEventPublisher) - .OnPublishAsObservable() + eventMessages => (this as IConnector) + .OnConnectAsObservable() .Select(x => (eventMessages ?? EventMessages.Create()).Append(x)) ); TargetConnectors - .OfType() + .OfType() .ToList() .ForEach(x => x.Connect(observable)); TargetConnectors - .OfType() + .OfType() .ToList() .ForEach(x => observable.Subscribe(x.OnReceive)); @@ -63,6 +63,6 @@ void IEventPublisher.Connect(IObservable source) } } - public abstract IObservable OnPublishAsObservable(); + public abstract IObservable OnConnectAsObservable(); } } \ No newline at end of file diff --git a/Assets/Scripts/EventPublisher.cs.meta b/Assets/Scripts/ConnectorBase.cs.meta similarity index 100% rename from Assets/Scripts/EventPublisher.cs.meta rename to Assets/Scripts/ConnectorBase.cs.meta diff --git a/Assets/Scripts/EventType.cs b/Assets/Scripts/ConnectorType.cs similarity index 78% rename from Assets/Scripts/EventType.cs rename to Assets/Scripts/ConnectorType.cs index df1f5ff..11bbe90 100644 --- a/Assets/Scripts/EventType.cs +++ b/Assets/Scripts/ConnectorType.cs @@ -1,6 +1,6 @@ -namespace EventConnector +namespace UniFlow { - public enum EventType + public enum ConnectorType { LifecycleEvent = 1, UIBehaviourEventTrigger, @@ -16,14 +16,20 @@ public enum EventType PhysicsTrigger2DEvent, AnimatorTrigger, + SimpleAnimationController, AnimationEvent, AudioController, AudioEvent, PlayableController, TimelineSignal, + LoadScene, + UnloadScene, + Timer, Interval, Empty, + + Custom, } } \ No newline at end of file diff --git a/Assets/Scripts/EventType.cs.meta b/Assets/Scripts/ConnectorType.cs.meta similarity index 100% rename from Assets/Scripts/EventType.cs.meta rename to Assets/Scripts/ConnectorType.cs.meta diff --git a/Assets/Scripts/EventConnectable.cs b/Assets/Scripts/EventConnectable.cs deleted file mode 100644 index 36f5611..0000000 --- a/Assets/Scripts/EventConnectable.cs +++ /dev/null @@ -1,8 +0,0 @@ -using UnityEngine; - -namespace EventConnector -{ - public abstract class EventConnectable : MonoBehaviour, IEventConnectable - { - } -} \ No newline at end of file diff --git a/Assets/Scripts/EventMessage.cs b/Assets/Scripts/EventMessage.cs new file mode 100644 index 0000000..c8ccd39 --- /dev/null +++ b/Assets/Scripts/EventMessage.cs @@ -0,0 +1,24 @@ +using JetBrains.Annotations; + +namespace UniFlow +{ + [PublicAPI] + public struct EventMessage + { + private EventMessage(ConnectorType connectorType, object sender, object data) + { + ConnectorType = connectorType; + Sender = sender; + Data = data; + } + + public ConnectorType ConnectorType { get; } + public object Sender { get; } + public object Data { get; } + + public static EventMessage Create(ConnectorType connectorType, object sender, object data = default) + { + return new EventMessage(connectorType, sender, data); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/EventMessage.cs.meta b/Assets/Scripts/EventMessage.cs.meta new file mode 100644 index 0000000..5104b80 --- /dev/null +++ b/Assets/Scripts/EventMessage.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1c21c6b5d290484eaada1c1fa2f9ed93 +timeCreated: 1565329674 \ No newline at end of file diff --git a/Assets/Scripts/EventMessages.cs b/Assets/Scripts/EventMessages.cs index 47ff01e..8ee7ab1 100644 --- a/Assets/Scripts/EventMessages.cs +++ b/Assets/Scripts/EventMessages.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using JetBrains.Annotations; -namespace EventConnector +namespace UniFlow { [PublicAPI] public class EventMessages : List @@ -27,24 +27,4 @@ public static EventMessages Create() return new EventMessages(); } } - - [PublicAPI] - public struct EventMessage - { - private EventMessage(EventType eventType, object sender, object eventData) - { - EventType = eventType; - Sender = sender; - EventData = eventData; - } - - public EventType EventType { get; } - public object Sender { get; } - public object EventData { get; } - - public static EventMessage Create(EventType eventType, object sender, object eventData = default) - { - return new EventMessage(eventType, sender, eventData); - } - } } \ No newline at end of file diff --git a/Assets/Scripts/EventReceiver.cs b/Assets/Scripts/EventReceiver.cs deleted file mode 100644 index 0ef480c..0000000 --- a/Assets/Scripts/EventReceiver.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace EventConnector -{ - public abstract class EventReceiver : EventConnectable, IEventReceiver - { - public abstract void OnReceive(EventMessages eventMessages); - } -} \ No newline at end of file diff --git a/Assets/Scripts/IConnectable.cs b/Assets/Scripts/IConnectable.cs new file mode 100644 index 0000000..7bc9021 --- /dev/null +++ b/Assets/Scripts/IConnectable.cs @@ -0,0 +1,6 @@ +namespace UniFlow +{ + public interface IConnectable + { + } +} \ No newline at end of file diff --git a/Assets/Scripts/IEventConnectable.cs.meta b/Assets/Scripts/IConnectable.cs.meta similarity index 100% rename from Assets/Scripts/IEventConnectable.cs.meta rename to Assets/Scripts/IConnectable.cs.meta diff --git a/Assets/Scripts/IConnector.cs b/Assets/Scripts/IConnector.cs new file mode 100644 index 0000000..f726959 --- /dev/null +++ b/Assets/Scripts/IConnector.cs @@ -0,0 +1,10 @@ +using System; + +namespace UniFlow +{ + public interface IConnector : IConnectable + { + IObservable OnConnectAsObservable(); + void Connect(IObservable source); + } +} \ No newline at end of file diff --git a/Assets/Scripts/IEventPublisher.cs.meta b/Assets/Scripts/IConnector.cs.meta similarity index 100% rename from Assets/Scripts/IEventPublisher.cs.meta rename to Assets/Scripts/IConnector.cs.meta diff --git a/Assets/Scripts/IEventConnectable.cs b/Assets/Scripts/IEventConnectable.cs deleted file mode 100644 index 7f17523..0000000 --- a/Assets/Scripts/IEventConnectable.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace EventConnector -{ - public interface IEventConnectable - { - } -} \ No newline at end of file diff --git a/Assets/Scripts/IEventPublisher.cs b/Assets/Scripts/IEventPublisher.cs deleted file mode 100644 index 745d360..0000000 --- a/Assets/Scripts/IEventPublisher.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace EventConnector -{ - public interface IEventPublisher : IEventConnectable - { - IObservable OnPublishAsObservable(); - void Connect(IObservable source); - } -} \ No newline at end of file diff --git a/Assets/Scripts/IEventReceiver.cs b/Assets/Scripts/IEventReceiver.cs deleted file mode 100644 index fe23d9e..0000000 --- a/Assets/Scripts/IEventReceiver.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace EventConnector -{ - public interface IEventReceiver : IEventConnectable - { - void OnReceive(EventMessages eventMessages); - } -} \ No newline at end of file diff --git a/Assets/Scripts/IReceiver.cs b/Assets/Scripts/IReceiver.cs new file mode 100644 index 0000000..101d511 --- /dev/null +++ b/Assets/Scripts/IReceiver.cs @@ -0,0 +1,7 @@ +namespace UniFlow +{ + public interface IReceiver : IConnectable + { + void OnReceive(EventMessages eventMessages); + } +} \ No newline at end of file diff --git a/Assets/Scripts/IEventReceiver.cs.meta b/Assets/Scripts/IReceiver.cs.meta similarity index 100% rename from Assets/Scripts/IEventReceiver.cs.meta rename to Assets/Scripts/IReceiver.cs.meta diff --git a/Assets/Scripts/Message/AnimatorTriggerEventData.cs b/Assets/Scripts/Message/AnimatorTriggerEventData.cs index 05b19f6..6b4f409 100644 --- a/Assets/Scripts/Message/AnimatorTriggerEventData.cs +++ b/Assets/Scripts/Message/AnimatorTriggerEventData.cs @@ -1,7 +1,7 @@ using JetBrains.Annotations; using UnityEngine; -namespace EventConnector.Message +namespace UniFlow.Message { [PublicAPI] public class AnimatorTriggerEventData diff --git a/Assets/Scripts/Message/AudioControllerEventData.cs b/Assets/Scripts/Message/AudioControllerEventData.cs index b5f58c5..97a2995 100644 --- a/Assets/Scripts/Message/AudioControllerEventData.cs +++ b/Assets/Scripts/Message/AudioControllerEventData.cs @@ -1,6 +1,6 @@ -using EventConnector.Connector; +using UniFlow.Connector; -namespace EventConnector.Message +namespace UniFlow.Message { public struct AudioControllerEventData { diff --git a/Assets/Scripts/Message/AudioEventData.cs b/Assets/Scripts/Message/AudioEventData.cs index 421639d..da1637d 100644 --- a/Assets/Scripts/Message/AudioEventData.cs +++ b/Assets/Scripts/Message/AudioEventData.cs @@ -1,6 +1,6 @@ -using EventConnector.Connector; +using UniFlow.Connector; -namespace EventConnector.Message +namespace UniFlow.Message { public struct AudioEventData { diff --git a/Assets/Scripts/Message/CameraEventData.cs b/Assets/Scripts/Message/CameraEventData.cs index 2d178e1..2c403db 100644 --- a/Assets/Scripts/Message/CameraEventData.cs +++ b/Assets/Scripts/Message/CameraEventData.cs @@ -1,6 +1,6 @@ -using EventConnector.Connector; +using UniFlow.Connector; -namespace EventConnector.Message +namespace UniFlow.Message { public class CameraEventData { diff --git a/Assets/Scripts/Message/LifecycleEventData.cs b/Assets/Scripts/Message/LifecycleEventData.cs index 6fc7196..3d8edf0 100644 --- a/Assets/Scripts/Message/LifecycleEventData.cs +++ b/Assets/Scripts/Message/LifecycleEventData.cs @@ -1,8 +1,8 @@ using System; -using EventConnector.Connector; using JetBrains.Annotations; +using UniFlow.Connector; -namespace EventConnector.Message +namespace UniFlow.Message { [Serializable][PublicAPI] public class LifecycleEventData diff --git a/Assets/Scripts/Message/MouseEventData.cs b/Assets/Scripts/Message/MouseEventData.cs index 2da6009..c53ea6e 100644 --- a/Assets/Scripts/Message/MouseEventData.cs +++ b/Assets/Scripts/Message/MouseEventData.cs @@ -1,6 +1,6 @@ -using EventConnector.Connector; +using UniFlow.Connector; -namespace EventConnector.Message +namespace UniFlow.Message { public class MouseEventData { diff --git a/Assets/Scripts/Message/ParticleEventData.cs b/Assets/Scripts/Message/ParticleEventData.cs index 4abb1bb..fa9aa4c 100644 --- a/Assets/Scripts/Message/ParticleEventData.cs +++ b/Assets/Scripts/Message/ParticleEventData.cs @@ -1,8 +1,8 @@ -using EventConnector.Connector; using JetBrains.Annotations; +using UniFlow.Connector; using UnityEngine; -namespace EventConnector.Message +namespace UniFlow.Message { [PublicAPI] public class ParticleEventData diff --git a/Assets/Scripts/Message/PhysicsCollision2DEventData.cs b/Assets/Scripts/Message/PhysicsCollision2DEventData.cs index d899ce1..4a03226 100644 --- a/Assets/Scripts/Message/PhysicsCollision2DEventData.cs +++ b/Assets/Scripts/Message/PhysicsCollision2DEventData.cs @@ -1,8 +1,8 @@ -using EventConnector.Connector; using JetBrains.Annotations; +using UniFlow.Connector; using UnityEngine; -namespace EventConnector.Message +namespace UniFlow.Message { [PublicAPI] public class PhysicsCollision2DEventData diff --git a/Assets/Scripts/Message/PhysicsCollisionEventData.cs b/Assets/Scripts/Message/PhysicsCollisionEventData.cs index 9579de8..e54887f 100644 --- a/Assets/Scripts/Message/PhysicsCollisionEventData.cs +++ b/Assets/Scripts/Message/PhysicsCollisionEventData.cs @@ -1,8 +1,8 @@ -using EventConnector.Connector; using JetBrains.Annotations; +using UniFlow.Connector; using UnityEngine; -namespace EventConnector.Message +namespace UniFlow.Message { [PublicAPI] public class PhysicsCollisionEventData diff --git a/Assets/Scripts/Message/PhysicsTrigger2DEventData.cs b/Assets/Scripts/Message/PhysicsTrigger2DEventData.cs index 6c39e0e..27f807a 100644 --- a/Assets/Scripts/Message/PhysicsTrigger2DEventData.cs +++ b/Assets/Scripts/Message/PhysicsTrigger2DEventData.cs @@ -1,8 +1,8 @@ -using EventConnector.Connector; using JetBrains.Annotations; +using UniFlow.Connector; using UnityEngine; -namespace EventConnector.Message +namespace UniFlow.Message { [PublicAPI] public class PhysicsTrigger2DEventData diff --git a/Assets/Scripts/Message/PhysicsTriggerEventData.cs b/Assets/Scripts/Message/PhysicsTriggerEventData.cs index 80e2f16..26599df 100644 --- a/Assets/Scripts/Message/PhysicsTriggerEventData.cs +++ b/Assets/Scripts/Message/PhysicsTriggerEventData.cs @@ -1,8 +1,8 @@ -using EventConnector.Connector; using JetBrains.Annotations; +using UniFlow.Connector; using UnityEngine; -namespace EventConnector.Message +namespace UniFlow.Message { [PublicAPI] public class PhysicsTriggerEventData diff --git a/Assets/Scripts/Message/PlayableControllerEventData.cs b/Assets/Scripts/Message/PlayableControllerEventData.cs index abc125e..7476033 100644 --- a/Assets/Scripts/Message/PlayableControllerEventData.cs +++ b/Assets/Scripts/Message/PlayableControllerEventData.cs @@ -1,8 +1,17 @@ -namespace EventConnector.Message +using UniFlow.Connector; + +namespace UniFlow.Message { public class PlayableControllerEventData { - public static PlayableControllerEventData Create() => - new PlayableControllerEventData(); + private PlayableControllerEventData(PlayableControlMethod playableControlMethod) + { + PlayableControlMethod = playableControlMethod; + } + + public PlayableControlMethod PlayableControlMethod { get; } + + public static PlayableControllerEventData Create(PlayableControlMethod playableControlMethod) => + new PlayableControllerEventData(playableControlMethod); } } \ No newline at end of file diff --git a/Assets/Scripts/Message/RectTransformEventData.cs b/Assets/Scripts/Message/RectTransformEventData.cs index 9d87576..0d3a3d2 100644 --- a/Assets/Scripts/Message/RectTransformEventData.cs +++ b/Assets/Scripts/Message/RectTransformEventData.cs @@ -1,7 +1,7 @@ -using EventConnector.Connector; using JetBrains.Annotations; +using UniFlow.Connector; -namespace EventConnector.Message +namespace UniFlow.Message { [PublicAPI] public class RectTransformEventData diff --git a/Assets/Scripts/Message/SimpleAnimationControllerEventData.cs b/Assets/Scripts/Message/SimpleAnimationControllerEventData.cs new file mode 100644 index 0000000..e455493 --- /dev/null +++ b/Assets/Scripts/Message/SimpleAnimationControllerEventData.cs @@ -0,0 +1,19 @@ +using JetBrains.Annotations; +using UniFlow.Connector; + +namespace UniFlow.Message +{ + [PublicAPI] + public struct SimpleAnimationControllerEventData + { + private SimpleAnimationControllerEventData(SimpleAnimationControlMethod simpleAnimationControlMethod) + { + SimpleAnimationControlMethod = simpleAnimationControlMethod; + } + + public SimpleAnimationControlMethod SimpleAnimationControlMethod { get; } + + public static SimpleAnimationControllerEventData Create(SimpleAnimationControlMethod audioControlMethod) => + new SimpleAnimationControllerEventData(audioControlMethod); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Message/SimpleAnimationControllerEventData.cs.meta b/Assets/Scripts/Message/SimpleAnimationControllerEventData.cs.meta new file mode 100644 index 0000000..30ce8ed --- /dev/null +++ b/Assets/Scripts/Message/SimpleAnimationControllerEventData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9d46cd952af74c3983c8a5533fa019ea +timeCreated: 1565255846 \ No newline at end of file diff --git a/Assets/Scripts/Message/TimelineEventData.cs b/Assets/Scripts/Message/TimelineEventData.cs index ff335ca..78d6eaf 100644 --- a/Assets/Scripts/Message/TimelineEventData.cs +++ b/Assets/Scripts/Message/TimelineEventData.cs @@ -3,7 +3,7 @@ using UnityEngine; using Object = UnityEngine.Object; -namespace EventConnector.Message +namespace UniFlow.Message { [Serializable][PublicAPI] public class TimelineEventData diff --git a/Assets/Scripts/Message/TransformEventData.cs b/Assets/Scripts/Message/TransformEventData.cs index 271ae3b..043ed70 100644 --- a/Assets/Scripts/Message/TransformEventData.cs +++ b/Assets/Scripts/Message/TransformEventData.cs @@ -1,7 +1,7 @@ -using EventConnector.Connector; using JetBrains.Annotations; +using UniFlow.Connector; -namespace EventConnector.Message +namespace UniFlow.Message { [PublicAPI] public class TransformEventData diff --git a/Assets/Scripts/Receiver.meta b/Assets/Scripts/Receiver.meta new file mode 100644 index 0000000..85f919c --- /dev/null +++ b/Assets/Scripts/Receiver.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 81b04987def84653bd09df060b83bb0b +timeCreated: 1565329110 \ No newline at end of file diff --git a/Assets/Scripts/EmptyEventReceiver.cs b/Assets/Scripts/Receiver/Empty.cs similarity index 62% rename from Assets/Scripts/EmptyEventReceiver.cs rename to Assets/Scripts/Receiver/Empty.cs index 403eaad..b2e4463 100644 --- a/Assets/Scripts/EmptyEventReceiver.cs +++ b/Assets/Scripts/Receiver/Empty.cs @@ -1,6 +1,6 @@ -namespace EventConnector +namespace UniFlow.Receiver { - public class EmptyEventReceiver : EventReceiver + public class Empty : ReceiverBase { public override void OnReceive(EventMessages eventMessages) { diff --git a/Assets/Scripts/EmptyEventReceiver.cs.meta b/Assets/Scripts/Receiver/Empty.cs.meta similarity index 100% rename from Assets/Scripts/EmptyEventReceiver.cs.meta rename to Assets/Scripts/Receiver/Empty.cs.meta diff --git a/Assets/Scripts/ReceiverBase.cs b/Assets/Scripts/ReceiverBase.cs new file mode 100644 index 0000000..0715041 --- /dev/null +++ b/Assets/Scripts/ReceiverBase.cs @@ -0,0 +1,7 @@ +namespace UniFlow +{ + public abstract class ReceiverBase : ConnectableBase, IReceiver + { + public abstract void OnReceive(EventMessages eventMessages); + } +} \ No newline at end of file diff --git a/Assets/Scripts/EventReceiver.cs.meta b/Assets/Scripts/ReceiverBase.cs.meta similarity index 100% rename from Assets/Scripts/EventReceiver.cs.meta rename to Assets/Scripts/ReceiverBase.cs.meta diff --git a/Assets/Tests/Runtime/Scenes/Basic/All.unity b/Assets/Tests/Runtime/Scenes/Basic/All.unity index 9d34da5..12a79af 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/All.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/All.unity @@ -310,9 +310,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c4c15fc42dc5482199932c4a3305f962, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 2024507135} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 playableDirector: {fileID: 2024507138} --- !u!4 &578503983 @@ -459,9 +459,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 986c65454dfa4cf6a69ff9328f793990, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1565437862} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 eventTriggerType: 2 uiBehaviour: {fileID: 0} @@ -631,9 +631,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 13ea2beab68d4b9695c5913d711525ca, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1729537389} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 animator: {fileID: 1729537390} triggerName: TestTrigger @@ -681,9 +681,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 79d730e2e15e4d688fab6e1a6d9f5e56, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 578503981} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 --- !u!95 &1729537390 Animator: @@ -750,9 +750,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7897bf78af8d443e83a6786b2e4fdfda, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 2070612652} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &2024507136 MonoBehaviour: @@ -852,8 +852,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!4 &2070612653 Transform: diff --git a/Assets/Tests/Runtime/Scenes/Basic/AnimationEvent.unity b/Assets/Tests/Runtime/Scenes/Basic/AnimationEvent.unity index 34b686d..a9afa0f 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/AnimationEvent.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/AnimationEvent.unity @@ -312,9 +312,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 79d730e2e15e4d688fab6e1a6d9f5e56, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1565437861} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 --- !u!95 &1565437859 Animator: @@ -361,8 +361,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!1 &2126485662 GameObject: diff --git a/Assets/Tests/Runtime/Scenes/Basic/AnimatorTrigger.unity b/Assets/Tests/Runtime/Scenes/Basic/AnimatorTrigger.unity index 15caac7..78aa4cf 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/AnimatorTrigger.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/AnimatorTrigger.unity @@ -313,9 +313,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 79d730e2e15e4d688fab6e1a6d9f5e56, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1565437861} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 --- !u!95 &1565437859 Animator: @@ -362,8 +362,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &1565437862 MonoBehaviour: @@ -377,9 +377,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 13ea2beab68d4b9695c5913d711525ca, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1565437858} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 animator: {fileID: 0} triggerName: TestTrigger diff --git a/Assets/Tests/Runtime/Scenes/Basic/AudioController.unity b/Assets/Tests/Runtime/Scenes/Basic/AudioController.unity index 4bf70b7..2b545da 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/AudioController.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/AudioController.unity @@ -222,8 +222,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &237918682 MonoBehaviour: @@ -237,9 +237,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 306f3948478b4806bd3270ce91a0c068, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 237918681} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 audioControlMethod: 0 audioSource: {fileID: 0} @@ -365,9 +365,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5c68da8d20a7460881ef721586f08251, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 237918682} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 seconds: 1 --- !u!1 &451877066 @@ -493,8 +493,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &709479484 MonoBehaviour: @@ -508,9 +508,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 306f3948478b4806bd3270ce91a0c068, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 709479483} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 audioControlMethod: 3 audioSource: {fileID: 0} @@ -636,9 +636,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5c68da8d20a7460881ef721586f08251, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 709479484} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 seconds: 1 --- !u!1 &1379110442 @@ -673,8 +673,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &1379110444 MonoBehaviour: @@ -688,9 +688,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 306f3948478b4806bd3270ce91a0c068, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1379110443} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 audioControlMethod: 1 audioSource: {fileID: 0} @@ -816,9 +816,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5c68da8d20a7460881ef721586f08251, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1379110444} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 seconds: 1 --- !u!1 &1766242780 @@ -853,8 +853,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &1766242782 MonoBehaviour: @@ -868,9 +868,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 306f3948478b4806bd3270ce91a0c068, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1766242781} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 audioControlMethod: 2 audioSource: {fileID: 0} @@ -996,9 +996,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5c68da8d20a7460881ef721586f08251, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1766242782} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 seconds: 1 --- !u!1 &2126485662 diff --git a/Assets/Tests/Runtime/Scenes/Basic/AudioEvent.unity b/Assets/Tests/Runtime/Scenes/Basic/AudioEvent.unity index efafaa4..09ae4bf 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/AudioEvent.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/AudioEvent.unity @@ -221,8 +221,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &169312998 MonoBehaviour: @@ -236,9 +236,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 169312997} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 audioEventType: 4 audioSource: {fileID: 0} @@ -383,8 +383,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &237918682 MonoBehaviour: @@ -398,9 +398,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 237918681} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 audioEventType: 0 audioSource: {fileID: 0} @@ -545,8 +545,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &424226963 MonoBehaviour: @@ -560,9 +560,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 424226962} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 audioEventType: 1 audioSource: {fileID: 0} @@ -710,8 +710,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &444551915 MonoBehaviour: @@ -725,9 +725,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 444551914} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 audioEventType: 1 audioSource: {fileID: 0} @@ -743,9 +743,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 444551915} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 audioEventType: 3 audioSource: {fileID: 0} @@ -761,9 +761,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 444551916} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 audioEventType: 2 audioSource: {fileID: 0} @@ -779,9 +779,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 444551917} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 audioEventType: 0 audioSource: {fileID: 0} @@ -1017,8 +1017,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &709479484 MonoBehaviour: @@ -1032,9 +1032,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 709479483} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 audioEventType: 3 audioSource: {fileID: 0} @@ -1179,8 +1179,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &1130731398 MonoBehaviour: @@ -1194,9 +1194,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1130731397} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 audioEventType: 0 audioSource: {fileID: 0} @@ -1341,8 +1341,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &1379110444 MonoBehaviour: @@ -1356,9 +1356,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1379110443} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 audioEventType: 1 audioSource: {fileID: 0} @@ -1503,8 +1503,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &1766242782 MonoBehaviour: @@ -1518,9 +1518,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5123bd7d9f1949adbf43f3b8391a5ebd, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1766242781} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 audioEventType: 2 audioSource: {fileID: 0} diff --git a/Assets/Tests/Runtime/Scenes/Basic/CameraEvent.unity b/Assets/Tests/Runtime/Scenes/Basic/CameraEvent.unity index 0bafa94..ac45ed3 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/CameraEvent.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/CameraEvent.unity @@ -387,8 +387,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &923815578 MonoBehaviour: @@ -402,9 +402,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2a133b3a9e6a4868ae2e11afff21cc6e, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 923815577} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 cameraEventType: 0 component: {fileID: 0} @@ -441,8 +441,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &1761951866 MonoBehaviour: @@ -456,9 +456,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2a133b3a9e6a4868ae2e11afff21cc6e, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1761951865} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 cameraEventType: 1 component: {fileID: 0} diff --git a/Assets/Tests/Runtime/Scenes/Basic/Interval.unity b/Assets/Tests/Runtime/Scenes/Basic/Interval.unity index e1e013d..cb78775 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/Interval.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/Interval.unity @@ -323,9 +323,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c75b5631c1dd457ca629666003c656b9, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1929524893} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 seconds: 1 --- !u!4 &1929524895 diff --git a/Assets/Tests/Runtime/Scenes/Basic/LifecycleEvent.unity b/Assets/Tests/Runtime/Scenes/Basic/LifecycleEvent.unity index d78d292..1f8c62b 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/LifecycleEvent.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/LifecycleEvent.unity @@ -149,9 +149,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 85a0f26910644eac9392a5b944f82349, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 2041475155} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 lifecycleEventType: 3 component: {fileID: 0} @@ -268,9 +268,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 85a0f26910644eac9392a5b944f82349, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 2041475155} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 lifecycleEventType: 2 component: {fileID: 0} @@ -317,9 +317,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 85a0f26910644eac9392a5b944f82349, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 2041475155} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 lifecycleEventType: 5 component: {fileID: 0} @@ -366,9 +366,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 85a0f26910644eac9392a5b944f82349, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 2041475155} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 lifecycleEventType: 4 component: {fileID: 0} @@ -506,9 +506,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 85a0f26910644eac9392a5b944f82349, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 2041475155} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 lifecycleEventType: 6 component: {fileID: 0} @@ -555,9 +555,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 85a0f26910644eac9392a5b944f82349, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 2041475155} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 lifecycleEventType: 0 component: {fileID: 0} @@ -604,9 +604,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 85a0f26910644eac9392a5b944f82349, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 2041475155} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 lifecycleEventType: 1 component: {fileID: 0} @@ -653,8 +653,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!4 &2041475156 Transform: diff --git a/Assets/Tests/Runtime/Scenes/Basic/PlayableController.unity b/Assets/Tests/Runtime/Scenes/Basic/PlayableController.unity index ba5a8a9..5a6ea46 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/PlayableController.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/PlayableController.unity @@ -315,9 +315,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7897bf78af8d443e83a6786b2e4fdfda, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 951080161} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 0 --- !u!114 &951080156 MonoBehaviour: @@ -418,9 +418,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c4c15fc42dc5482199932c4a3305f962, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 951080155} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 playableDirector: {fileID: 0} --- !u!114 &951080161 @@ -435,8 +435,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!1 &2126485662 GameObject: diff --git a/Assets/Tests/Runtime/Scenes/Basic/TimelineSignal.unity b/Assets/Tests/Runtime/Scenes/Basic/TimelineSignal.unity index 9c9aa20..48f5ed8 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/TimelineSignal.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/TimelineSignal.unity @@ -314,9 +314,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7897bf78af8d443e83a6786b2e4fdfda, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 951080160} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 --- !u!114 &951080156 MonoBehaviour: @@ -415,8 +415,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!1 &2126485662 GameObject: diff --git a/Assets/Tests/Runtime/Scenes/Basic/Timer.unity b/Assets/Tests/Runtime/Scenes/Basic/Timer.unity index 214fb7a..efe7eb7 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/Timer.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/Timer.unity @@ -323,9 +323,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5c68da8d20a7460881ef721586f08251, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 1929524893} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 seconds: 1 --- !u!4 &1929524895 diff --git a/Assets/Tests/Runtime/Scenes/Basic/UIBehaviourEventTrigger.unity b/Assets/Tests/Runtime/Scenes/Basic/UIBehaviourEventTrigger.unity index f6f97bf..74b3347 100644 --- a/Assets/Tests/Runtime/Scenes/Basic/UIBehaviourEventTrigger.unity +++ b/Assets/Tests/Runtime/Scenes/Basic/UIBehaviourEventTrigger.unity @@ -431,9 +431,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 986c65454dfa4cf6a69ff9328f793990, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: + targetComponents: - {fileID: 751339852} - targetConnectorIds: [] + targetIds: [] actAsTrigger: 1 eventTriggerType: 4 uiBehaviour: {fileID: 0} @@ -487,8 +487,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 74f05c1452df4e608e510b8e0954c294, type: 3} m_Name: m_EditorClassIdentifier: - targetConnectorInstances: [] - targetConnectorIds: [] + targetComponents: [] + targetIds: [] actAsTrigger: 0 --- !u!1 &1538909814 GameObject: diff --git a/Assets/Tests/Runtime/Scripts/AllTest.cs b/Assets/Tests/Runtime/Scripts/AllTest.cs index e429b80..d23e3c9 100644 --- a/Assets/Tests/Runtime/Scripts/AllTest.cs +++ b/Assets/Tests/Runtime/Scripts/AllTest.cs @@ -1,19 +1,18 @@ using System.Collections; -using EventConnector; -using EventConnector.Connector; -using EventConnector.Message; using NUnit.Framework; +using UniFlow.Connector; +using UniFlow.Message; using UniRx.Triggers; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Playables; using UnityEngine.TestTools; using UnityEngine.UI; -using AnimationEvent = EventConnector.Connector.AnimationEvent; +using AnimationEvent = UniFlow.Connector.AnimationEvent; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class AllTest : EventConnectorTestBase + public class AllTest : UniFlowTestBase { [UnityTest] public IEnumerator All() @@ -51,14 +50,14 @@ private void AssertAll(EventMessages eventMessages) Assert.AreEqual(5, eventMessages.Count); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); + Assert.IsInstanceOf(eventMessages[0].Data); Assert.IsInstanceOf(eventMessages[1].Sender); - Assert.IsInstanceOf(eventMessages[1].EventData); + Assert.IsInstanceOf(eventMessages[1].Data); Assert.IsInstanceOf(eventMessages[2].Sender); - Assert.IsInstanceOf(eventMessages[2].EventData); - var animationEvent = eventMessages[2].EventData as UnityEngine.AnimationEvent; + Assert.IsInstanceOf(eventMessages[2].Data); + var animationEvent = eventMessages[2].Data as UnityEngine.AnimationEvent; Assert.NotNull(animationEvent); Assert.AreEqual(222.2f, animationEvent.floatParameter); Assert.AreEqual(333, animationEvent.intParameter); @@ -67,11 +66,11 @@ private void AssertAll(EventMessages eventMessages) Assert.AreEqual("All", animationEvent.objectReferenceParameter.name); Assert.IsInstanceOf(eventMessages[3].Sender); - Assert.IsInstanceOf(eventMessages[3].EventData); + Assert.IsInstanceOf(eventMessages[3].Data); Assert.IsInstanceOf(eventMessages[4].Sender); - Assert.IsInstanceOf(eventMessages[4].EventData); - var timelineEvent = eventMessages[4].EventData as TimelineEventData; + Assert.IsInstanceOf(eventMessages[4].Data); + var timelineEvent = eventMessages[4].Data as TimelineEventData; Assert.NotNull(timelineEvent); Assert.AreEqual(999, timelineEvent.IntParameter); HasAssert = true; diff --git a/Assets/Tests/Runtime/Scripts/AnimationEventTest.cs b/Assets/Tests/Runtime/Scripts/AnimationEventTest.cs index 7122622..c95e4d7 100644 --- a/Assets/Tests/Runtime/Scripts/AnimationEventTest.cs +++ b/Assets/Tests/Runtime/Scripts/AnimationEventTest.cs @@ -2,11 +2,11 @@ using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; -using AnimationEvent = EventConnector.Connector.AnimationEvent; +using AnimationEvent = UniFlow.Connector.AnimationEvent; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class AnimationEventTest : EventConnectorTestBase + public class AnimationEventTest : UniFlowTestBase { [UnityTest] public IEnumerator AnimationEvent() @@ -25,8 +25,8 @@ private void AssertAnimationEvent(EventMessages eventMessages) Assert.AreEqual(1, eventMessages.Count); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); - var animationEvent = eventMessages[0].EventData as UnityEngine.AnimationEvent; + Assert.IsInstanceOf(eventMessages[0].Data); + var animationEvent = eventMessages[0].Data as UnityEngine.AnimationEvent; Assert.NotNull(animationEvent); Assert.AreEqual(11.1f, animationEvent.floatParameter); Assert.AreEqual(22, animationEvent.intParameter); diff --git a/Assets/Tests/Runtime/Scripts/AnimatorTriggerTest.cs b/Assets/Tests/Runtime/Scripts/AnimatorTriggerTest.cs index d0ebafe..36919a4 100644 --- a/Assets/Tests/Runtime/Scripts/AnimatorTriggerTest.cs +++ b/Assets/Tests/Runtime/Scripts/AnimatorTriggerTest.cs @@ -1,13 +1,13 @@ using System.Collections; -using EventConnector.Message; +using UniFlow.Message; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; -using AnimationEvent = EventConnector.Connector.AnimationEvent; +using AnimationEvent = UniFlow.Connector.AnimationEvent; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class AnimatorTriggerTest : EventConnectorTestBase + public class AnimatorTriggerTest : UniFlowTestBase { [UnityTest] public IEnumerator AnimatorTrigger() @@ -26,11 +26,11 @@ private void AssertAnimatorTrigger(EventMessages eventMessages) Assert.AreEqual(2, eventMessages.Count); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); + Assert.IsInstanceOf(eventMessages[0].Data); Assert.IsInstanceOf(eventMessages[1].Sender); - Assert.IsInstanceOf(eventMessages[1].EventData); - var animationEvent = eventMessages[1].EventData as UnityEngine.AnimationEvent; + Assert.IsInstanceOf(eventMessages[1].Data); + var animationEvent = eventMessages[1].Data as UnityEngine.AnimationEvent; Assert.NotNull(animationEvent); Assert.AreEqual(22.2f, animationEvent.floatParameter); Assert.AreEqual(33, animationEvent.intParameter); diff --git a/Assets/Tests/Runtime/Scripts/AudioControllerTest.cs b/Assets/Tests/Runtime/Scripts/AudioControllerTest.cs index 43e5141..08d309d 100644 --- a/Assets/Tests/Runtime/Scripts/AudioControllerTest.cs +++ b/Assets/Tests/Runtime/Scripts/AudioControllerTest.cs @@ -1,17 +1,17 @@ using System; using System.Collections; using System.Linq; -using EventConnector.Connector; -using EventConnector.Message; +using UniFlow.Connector; +using UniFlow.Message; using NUnit.Framework; using UniRx; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.TestTools; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class AudioControllerTest : EventConnectorTestBase + public class AudioControllerTest : UniFlowTestBase { [UnityTest] public IEnumerator Play() @@ -138,11 +138,11 @@ private void AssertAudioEvent(EventMessages eventMessages, AudioControlMethod au Assert.AreEqual(2, eventMessages.Count); Assert.IsInstanceOf(eventMessages[1].Sender); - Assert.IsInstanceOf(eventMessages[1].EventData); + Assert.IsInstanceOf(eventMessages[1].Data); - Assert.NotNull(eventMessages[1].EventData); + Assert.NotNull(eventMessages[1].Data); - Assert.AreEqual(audioControlMethod, ((AudioControllerEventData) eventMessages[1].EventData).AudioControlMethod); + Assert.AreEqual(audioControlMethod, ((AudioControllerEventData) eventMessages[1].Data).AudioControlMethod); callback(eventMessages[1].Sender as AudioSource); diff --git a/Assets/Tests/Runtime/Scripts/AudioEventTest.cs b/Assets/Tests/Runtime/Scripts/AudioEventTest.cs index 9d4a9cb..3ccb80f 100644 --- a/Assets/Tests/Runtime/Scripts/AudioEventTest.cs +++ b/Assets/Tests/Runtime/Scripts/AudioEventTest.cs @@ -1,8 +1,8 @@ using System; using System.Collections; using System.Linq; -using EventConnector.Connector; -using EventConnector.Message; +using UniFlow.Connector; +using UniFlow.Message; using NUnit.Framework; using UniRx; using UnityEngine; @@ -10,9 +10,9 @@ using UnityEngine.TestTools; using Object = UnityEngine.Object; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class AudioEventTest : EventConnectorTestBase + public class AudioEventTest : UniFlowTestBase { [UnityTest] public IEnumerator PlayEvent() @@ -182,10 +182,10 @@ public IEnumerator ComplexEvent() { Assert.NotNull(em); Assert.AreEqual(4, em.Count); - Assert.AreEqual(AudioEventType.Play, ((AudioEventData) em[0].EventData).EventType); - Assert.AreEqual(AudioEventType.Pause, ((AudioEventData) em[1].EventData).EventType); - Assert.AreEqual(AudioEventType.UnPause, ((AudioEventData) em[2].EventData).EventType); - Assert.AreEqual(AudioEventType.Stop, ((AudioEventData) em[3].EventData).EventType); + Assert.AreEqual(AudioEventType.Play, ((AudioEventData) em[0].Data).EventType); + Assert.AreEqual(AudioEventType.Pause, ((AudioEventData) em[1].Data).EventType); + Assert.AreEqual(AudioEventType.UnPause, ((AudioEventData) em[2].Data).EventType); + Assert.AreEqual(AudioEventType.Stop, ((AudioEventData) em[3].Data).EventType); HasAssert = true; }, () => @@ -212,11 +212,11 @@ private void AssertAudioEvent(EventMessages eventMessages, AudioEventType audioE Assert.AreEqual(receiveCount, Object.FindObjectOfType().ReceiveCount); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); + Assert.IsInstanceOf(eventMessages[0].Data); - Assert.NotNull(eventMessages[0].EventData); + Assert.NotNull(eventMessages[0].Data); - Assert.AreEqual(audioEventType, ((AudioEventData) eventMessages[0].EventData).EventType); + Assert.AreEqual(audioEventType, ((AudioEventData) eventMessages[0].Data).EventType); HasAssert = true; } diff --git a/Assets/Tests/Runtime/Scripts/CameraEventTest.cs b/Assets/Tests/Runtime/Scripts/CameraEventTest.cs index e4f7b84..ccdf6ff 100644 --- a/Assets/Tests/Runtime/Scripts/CameraEventTest.cs +++ b/Assets/Tests/Runtime/Scripts/CameraEventTest.cs @@ -1,17 +1,17 @@ using System; using System.Collections; using System.Linq; -using EventConnector.Connector; -using EventConnector.Message; +using UniFlow.Connector; +using UniFlow.Message; using NUnit.Framework; using UniRx; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.TestTools; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class CameraEventTest : EventConnectorTestBase + public class CameraEventTest : UniFlowTestBase { [UnityTest] public IEnumerator CameraBecomeVisibleEvent() @@ -61,11 +61,11 @@ private void AssertCameraBecomeVisibleEvent(EventMessages eventMessages) Assert.AreEqual(1, eventMessages.Count); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); + Assert.IsInstanceOf(eventMessages[0].Data); - Assert.NotNull(eventMessages[0].EventData); + Assert.NotNull(eventMessages[0].Data); - Assert.AreEqual(CameraEventType.BecomeVisible, ((CameraEventData) eventMessages[0].EventData).EventType); + Assert.AreEqual(CameraEventType.BecomeVisible, ((CameraEventData) eventMessages[0].Data).EventType); HasAssert = true; } @@ -76,11 +76,11 @@ private void AssertCameraBecomeInvisibleEvent(EventMessages eventMessages) Assert.AreEqual(1, eventMessages.Count); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); + Assert.IsInstanceOf(eventMessages[0].Data); - Assert.NotNull(eventMessages[0].EventData); + Assert.NotNull(eventMessages[0].Data); - Assert.AreEqual(CameraEventType.BecomeInvisible, ((CameraEventData) eventMessages[0].EventData).EventType); + Assert.AreEqual(CameraEventType.BecomeInvisible, ((CameraEventData) eventMessages[0].Data).EventType); HasAssert = true; } diff --git a/Assets/Tests/Runtime/Scripts/IntervalTest.cs b/Assets/Tests/Runtime/Scripts/IntervalTest.cs index a7e9ca0..1d19378 100644 --- a/Assets/Tests/Runtime/Scripts/IntervalTest.cs +++ b/Assets/Tests/Runtime/Scripts/IntervalTest.cs @@ -1,11 +1,11 @@ using System.Collections; -using EventConnector.Connector; +using UniFlow.Connector; using NUnit.Framework; using UnityEngine.TestTools; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class IntervalTest : EventConnectorTestBase + public class IntervalTest : UniFlowTestBase { [UnityTest] public IEnumerator Interval() @@ -24,10 +24,10 @@ private void AssertInterval(EventMessages eventMessages) Assert.AreEqual(2, UnityEngine.Object.FindObjectOfType().ReceiveCount); Assert.AreEqual(1, eventMessages.Count); - Assert.AreEqual(EventType.Interval, eventMessages[0].EventType); + Assert.AreEqual(ConnectorType.Interval, eventMessages[0].ConnectorType); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); - Assert.AreEqual(1.0f, eventMessages[0].EventData); + Assert.IsInstanceOf(eventMessages[0].Data); + Assert.AreEqual(1.0f, eventMessages[0].Data); HasAssert = true; } diff --git a/Assets/Tests/Runtime/Scripts/LifecycleEventTest.cs b/Assets/Tests/Runtime/Scripts/LifecycleEventTest.cs index c498228..1cabda8 100644 --- a/Assets/Tests/Runtime/Scripts/LifecycleEventTest.cs +++ b/Assets/Tests/Runtime/Scripts/LifecycleEventTest.cs @@ -1,8 +1,8 @@ using System; using System.Collections; using System.Linq; -using EventConnector.Connector; -using EventConnector.Message; +using UniFlow.Connector; +using UniFlow.Message; using NUnit.Framework; using UniRx; using UnityEngine; @@ -10,9 +10,9 @@ using UnityEngine.TestTools; using Object = UnityEngine.Object; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class LifecycleEventTest : EventConnectorTestBase + public class LifecycleEventTest : UniFlowTestBase { private LifecycleEventType CurrentLifecycleEventType { get; set; } @@ -102,9 +102,9 @@ private void AssertLifecycleEvent(EventMessages eventMessages) Assert.GreaterOrEqual(eventMessages.Count, 1); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); + Assert.IsInstanceOf(eventMessages[0].Data); - Assert.AreEqual(CurrentLifecycleEventType, ((LifecycleEventData) eventMessages[0].EventData).EventType); + Assert.AreEqual(CurrentLifecycleEventType, ((LifecycleEventData) eventMessages[0].Data).EventType); HasAssert = true; } diff --git a/Assets/Tests/Runtime/Scripts/PlayableControllerTest.cs b/Assets/Tests/Runtime/Scripts/PlayableControllerTest.cs index ffd97b2..2639aa8 100644 --- a/Assets/Tests/Runtime/Scripts/PlayableControllerTest.cs +++ b/Assets/Tests/Runtime/Scripts/PlayableControllerTest.cs @@ -1,13 +1,13 @@ using System.Collections; -using EventConnector.Connector; -using EventConnector.Message; +using UniFlow.Connector; +using UniFlow.Message; using NUnit.Framework; using UnityEngine.Playables; using UnityEngine.TestTools; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class PlayableControllerTest : EventConnectorTestBase + public class PlayableControllerTest : UniFlowTestBase { [UnityTest] @@ -27,11 +27,11 @@ private void AssertPlayableController(EventMessages eventMessages) Assert.AreEqual(2, eventMessages.Count); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); + Assert.IsInstanceOf(eventMessages[0].Data); Assert.IsInstanceOf(eventMessages[1].Sender); - Assert.IsInstanceOf(eventMessages[1].EventData); - var timelineEvent = eventMessages[1].EventData as TimelineEventData; + Assert.IsInstanceOf(eventMessages[1].Data); + var timelineEvent = eventMessages[1].Data as TimelineEventData; Assert.NotNull(timelineEvent); Assert.AreEqual("PlayableControllerTest", timelineEvent.StringParameter); HasAssert = true; diff --git a/Assets/Tests/Runtime/Scripts/TestReceiver.cs b/Assets/Tests/Runtime/Scripts/TestReceiver.cs index 9ec0ec6..ff78d7d 100644 --- a/Assets/Tests/Runtime/Scripts/TestReceiver.cs +++ b/Assets/Tests/Runtime/Scripts/TestReceiver.cs @@ -1,6 +1,6 @@ -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class TestReceiver : EventReceiver + public class TestReceiver : ReceiverBase { public EventMessages SentEventMessages { get; private set; } public int ReceiveCount { get; private set; } diff --git a/Assets/Tests/Runtime/Scripts/TimelineSignalTest.cs b/Assets/Tests/Runtime/Scripts/TimelineSignalTest.cs index 912f264..717434c 100644 --- a/Assets/Tests/Runtime/Scripts/TimelineSignalTest.cs +++ b/Assets/Tests/Runtime/Scripts/TimelineSignalTest.cs @@ -1,12 +1,12 @@ using System.Collections; -using EventConnector.Connector; -using EventConnector.Message; +using UniFlow.Connector; +using UniFlow.Message; using NUnit.Framework; using UnityEngine.TestTools; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class TimelineSignalTest : EventConnectorTestBase + public class TimelineSignalTest : UniFlowTestBase { [UnityTest] public IEnumerator TimelineSignal() @@ -25,8 +25,8 @@ private void AssertTimelineSignal(EventMessages eventMessages) Assert.AreEqual(1, eventMessages.Count); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); - var timelineEvent = eventMessages[0].EventData as TimelineEventData; + Assert.IsInstanceOf(eventMessages[0].Data); + var timelineEvent = eventMessages[0].Data as TimelineEventData; Assert.NotNull(timelineEvent); Assert.AreEqual("TimelineSignalTest", timelineEvent.StringParameter); HasAssert = true; diff --git a/Assets/Tests/Runtime/Scripts/TimerTest.cs b/Assets/Tests/Runtime/Scripts/TimerTest.cs index 2fa8513..6fc0d87 100644 --- a/Assets/Tests/Runtime/Scripts/TimerTest.cs +++ b/Assets/Tests/Runtime/Scripts/TimerTest.cs @@ -1,11 +1,11 @@ using System.Collections; -using EventConnector.Connector; +using UniFlow.Connector; using NUnit.Framework; using UnityEngine.TestTools; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class TimerTest : EventConnectorTestBase + public class TimerTest : UniFlowTestBase { [UnityTest] public IEnumerator Timer() @@ -23,10 +23,10 @@ private void AssertTimer(EventMessages eventMessages) { Assert.AreEqual(1, eventMessages.Count); - Assert.AreEqual(EventType.Timer, eventMessages[0].EventType); + Assert.AreEqual(ConnectorType.Timer, eventMessages[0].ConnectorType); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); - Assert.AreEqual(1.0f, eventMessages[0].EventData); + Assert.IsInstanceOf(eventMessages[0].Data); + Assert.AreEqual(1.0f, eventMessages[0].Data); HasAssert = true; } diff --git a/Assets/Tests/Runtime/Scripts/UIBehaviourEventTest.cs b/Assets/Tests/Runtime/Scripts/UIBehaviourEventTest.cs index df69802..2599810 100644 --- a/Assets/Tests/Runtime/Scripts/UIBehaviourEventTest.cs +++ b/Assets/Tests/Runtime/Scripts/UIBehaviourEventTest.cs @@ -6,9 +6,9 @@ using UnityEngine.TestTools; using UnityEngine.UI; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public class UIBehaviourEventTest : EventConnectorTestBase + public class UIBehaviourEventTest : UniFlowTestBase { [UnityTest] public IEnumerator UIBehaviourEventTrigger() @@ -29,7 +29,7 @@ private void AssertUIBehaviourEventTrigger(EventMessages eventMessages) Assert.AreEqual(1, eventMessages.Count); Assert.IsInstanceOf(eventMessages[0].Sender); - Assert.IsInstanceOf(eventMessages[0].EventData); + Assert.IsInstanceOf(eventMessages[0].Data); HasAssert = true; } } diff --git a/Assets/Tests/Runtime/Scripts/EventConnectorTestBase.cs b/Assets/Tests/Runtime/Scripts/UniFlowTestBase.cs similarity index 92% rename from Assets/Tests/Runtime/Scripts/EventConnectorTestBase.cs rename to Assets/Tests/Runtime/Scripts/UniFlowTestBase.cs index 9a37e56..80103c0 100644 --- a/Assets/Tests/Runtime/Scripts/EventConnectorTestBase.cs +++ b/Assets/Tests/Runtime/Scripts/UniFlowTestBase.cs @@ -6,9 +6,9 @@ using Zenject; using Object = UnityEngine.Object; -namespace EventConnector.Tests.Runtime +namespace UniFlow.Tests.Runtime { - public abstract class EventConnectorTestBase : ZenjectIntegrationTestFixture + public abstract class UniFlowTestBase : ZenjectIntegrationTestFixture { private const string ScenePath = "Tests/Runtime/Scenes/Basic/"; protected bool HasAssert { private get; set; } diff --git a/Assets/Tests/Runtime/Scripts/EventConnectorTestBase.cs.meta b/Assets/Tests/Runtime/Scripts/UniFlowTestBase.cs.meta similarity index 100% rename from Assets/Tests/Runtime/Scripts/EventConnectorTestBase.cs.meta rename to Assets/Tests/Runtime/Scripts/UniFlowTestBase.cs.meta diff --git a/Assets/Tests/Runtime/EventConnector.Tests.Runtime.asmdef b/Assets/Tests/Runtime/UniFlow.Tests.Runtime.asmdef similarity index 93% rename from Assets/Tests/Runtime/EventConnector.Tests.Runtime.asmdef rename to Assets/Tests/Runtime/UniFlow.Tests.Runtime.asmdef index 2f67dfc..45a7c4f 100644 --- a/Assets/Tests/Runtime/EventConnector.Tests.Runtime.asmdef +++ b/Assets/Tests/Runtime/UniFlow.Tests.Runtime.asmdef @@ -1,5 +1,5 @@ { - "name": "EventConnector.Tests.Runtime", + "name": "UniFlow.Tests.Runtime", "references": [ "GUID:04f82f1ff3df44e29a1b2cce70510c34", "GUID:560b04d1a97f54a4e82edc0cbbb69285", diff --git a/Assets/Tests/Runtime/EventConnector.Tests.Runtime.asmdef.meta b/Assets/Tests/Runtime/UniFlow.Tests.Runtime.asmdef.meta similarity index 100% rename from Assets/Tests/Runtime/EventConnector.Tests.Runtime.asmdef.meta rename to Assets/Tests/Runtime/UniFlow.Tests.Runtime.asmdef.meta diff --git a/Assets/EventConnector.asmdef b/Assets/UniFlow.asmdef similarity index 77% rename from Assets/EventConnector.asmdef rename to Assets/UniFlow.asmdef index 41d7219..d69bf5e 100644 --- a/Assets/EventConnector.asmdef +++ b/Assets/UniFlow.asmdef @@ -1,11 +1,12 @@ { - "name": "EventConnector", + "name": "UniFlow", "references": [ "GUID:f06555f75b070af458a003d92f9efb00", + "GUID:aff632302a0b84b498c3f33f7639b4d3", "GUID:560b04d1a97f54a4e82edc0cbbb69285", + "GUID:f51ebe6a0ceec4240a699833d6309b23", "GUID:0d8beb7f090555447a6cf5ce9e54dbb4" ], - "optionalUnityReferences": [], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, diff --git a/Assets/EventConnector.asmdef.meta b/Assets/UniFlow.asmdef.meta similarity index 100% rename from Assets/EventConnector.asmdef.meta rename to Assets/UniFlow.asmdef.meta diff --git a/Assets/package.json b/Assets/package.json index 1f6fe05..42ab12f 100644 --- a/Assets/package.json +++ b/Assets/package.json @@ -1,9 +1,9 @@ { - "name": "dev.monry.upm.eventconnector", - "displayName": "Event Connector", - "version": "0.0.4-preview.5", + "name": "dev.monry.uniflow", + "displayName": "UniFlow", + "version": "0.0.5-preview.6", "unity": "2019.2", - "description": "EventConnector is a library that can connect various Unity events including user interaction without writing any C# script. Processes such as \"Tutorial that accepts user interaction\" and \"Waiting for the end of playback of Animation, Audio, Timeline, etc.\" can be implemented easily.", + "description": "UniFlow is a library that can connect various Unity events including user interaction without writing any C# script. Processes such as \"Tutorial that accepts user interaction\" and \"Waiting for the end of playback of Animation, Audio, Timeline, etc.\" can be implemented easily.", "author": { "name": "Tetsuya Mori", "url": "https://me.monry.dev/", @@ -13,11 +13,13 @@ "keywords": [], "category": "", "dependencies": { + "com.unity.simpleanimation": "1.0.0", "com.stevevermeulen.extenject": "9.1.0", - "jp.cysharp.unirx": "7.1.0" + "jp.cysharp.unirx": "7.1.0", + "jp.cysharp.unitask": "1.0.0" }, "repository": { "type": "git", - "url": "https://github.com/monry/EventConnector" + "url": "https://github.com/monry/UniFlow" } } diff --git a/Packages/manifest.json b/Packages/manifest.json index 015dbc3..64635d8 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -4,9 +4,10 @@ "name": "Unofficial Unity Package Manager Registry", "url": "https://upm-packages.dev", "scopes": [ + "com.unity.simpleanimation", "com.stevevermeulen", "jp.cysharp", - "dev.monry.upm" + "dev.monry" ] } ], @@ -23,6 +24,7 @@ "com.unity.multiplayer-hlapi": "1.0.2", "com.unity.package-manager-ui": "2.2.0", "com.unity.purchasing": "2.0.6", + "com.unity.simpleanimation": "1.0.0", "com.unity.test-framework": "1.0.13", "com.unity.textmeshpro": "2.0.1", "com.unity.timeline": "1.1.0", @@ -59,6 +61,7 @@ "com.unity.modules.video": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", - "com.unity.modules.xr": "1.0.0" + "com.unity.modules.xr": "1.0.0", + "jp.cysharp.unitask": "1.0.0" } } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index eff3339..0733b88 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -13,7 +13,7 @@ PlayerSettings: useOnDemandResources: 0 accelerometerFrequency: 60 companyName: DefaultCompany - productName: EventConnector + productName: UniFlow defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}