Skip to content

Commit 17da475

Browse files
committed
Clean up, removing obsolete code, reducing the helpers package.
1 parent d0afc46 commit 17da475

6 files changed

Lines changed: 19 additions & 31 deletions

File tree

Assets/Plugins/UnityTutorialSystem/Scenes/Scripts/CharacterBehaviour.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public class CharacterBehaviour : MonoBehaviour
1515
[SerializeField] float rotationSpeed;
1616
[SerializeField] bool independentHeadMovement;
1717
[SerializeField] bool invertHeadLook;
18-
CharacterController characterController;
1918
[SerializeField] Transform head;
2019
[SerializeField] bool mouseMovement;
20+
CharacterController characterController;
2121
public UnityEvent MovementBlocked;
2222
public UnityEvent Moving;
2323

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,43 @@
1-
using UnityEngine;
1+
using System;
2+
using UnityEngine;
3+
using UnityEngine.Events;
24

35
namespace TutorialSystem.Events
46
{
5-
[CreateAssetMenu(menuName = "Event Stream/Logging")]
6-
public class LogEventStream : ScriptableObject
7+
public class LogEventStream : MonoBehaviour
78
{
89
[SerializeField] BasicEventStream stream;
910
[SerializeField] bool enabled;
11+
readonly UnityAction<BasicEventStreamMessage> messageHandler;
12+
13+
public LogEventStream()
14+
{
15+
messageHandler = OnEventReceived;
16+
}
1017

1118
void OnDisable()
1219
{
1320
if (stream != null)
1421
{
15-
stream.ReceivedEvent.RemoveListener(OnEventReceived);
22+
stream.ReceivedEvent.RemoveListener(messageHandler);
1623
}
1724
}
1825

19-
void OnEventReceived(BasicEventStreamMessage message)
26+
void OnEnable()
2027
{
21-
if (enabled)
28+
if (stream != null)
2229
{
23-
Debug.Log(message);
30+
stream.ReceivedEvent.AddListener(messageHandler);
2431
}
2532
}
2633

27-
void OnEnable()
34+
void OnEventReceived(BasicEventStreamMessage message)
2835
{
29-
if (stream != null)
36+
if (enabled)
3037
{
31-
stream.ReceivedEvent.AddListener(OnEventReceived);
38+
Debug.Log(message);
3239
}
3340
}
41+
3442
}
3543
}

Assets/Plugins/UnityTutorialSystem/Scripts/Helpers/NextEventAggregationActivator.cs renamed to Assets/Plugins/UnityTutorialSystem/Scripts/Events/NextEventAggregationActivator.cs

File renamed without changes.

Assets/Plugins/UnityTutorialSystem/Scripts/Helpers/NextEventAggregationActivator.cs.meta renamed to Assets/Plugins/UnityTutorialSystem/Scripts/Events/NextEventAggregationActivator.cs.meta

File renamed without changes.

Assets/Plugins/UnityTutorialSystem/Scripts/UI/Trees/SelectionMode.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

Assets/Plugins/UnityTutorialSystem/Scripts/UI/Trees/SelectionMode.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)