Skip to content

Commit 7bc7dd0

Browse files
committed
- Fixing namescape from NED.GenericMessaingSystem to NED.GenericMessagingSystem
- Change CreateAllStorage in awake be in Constructor of BaseEventManager
1 parent 6f03079 commit 7bc7dd0

File tree

12 files changed

+26
-18
lines changed

12 files changed

+26
-18
lines changed

Assets/Extensions/GenericMessagingSystem/Core/BaseMessagingManager.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using UnityEngine;
99
using UnityEngine.Assertions;
1010

11-
namespace NED.GenericMessaingSystem
11+
namespace NED.GenericMessagingSystem
1212
{
1313
/// <summary>
1414
/// Base class for All Messaging Manager
@@ -25,11 +25,8 @@ public abstract class BaseMessagingManager : MonoBehaviour
2525
/// Called automaticly by Internal Unity
2626
/// Call <see cref="CreateAllStorage()"/> in implementation
2727
/// </summary>
28-
protected virtual void Awake()
28+
public BaseMessagingManager()
2929
{
30-
#if UNITY_EDITOR
31-
if (EnableDebug) Debug.Log("Awake");
32-
#endif
3330
CreateAllStorage();
3431
}
3532

@@ -96,7 +93,10 @@ public void Add<D, I>(I handler) where D : IMessageDomain where I : IMessageList
9693

9794
Assert.IsNotNull<List<I>>(HandlerStorage<D, I>.Handlers, "Handler storage not created yet!");
9895

99-
HandlerStorage<D, I>.Handlers.Add(handler);
96+
if (HandlerStorage<D, I>.Handlers != null)
97+
{
98+
HandlerStorage<D, I>.Handlers.Add(handler);
99+
}
100100
}
101101

102102
/// <summary>

Assets/Extensions/GenericMessagingSystem/Core/GlobalMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// See the LICENSE file in the project root for more information.
33
// Created By Leo Pripos Marbun
44

5-
namespace NED.GenericMessaingSystem
5+
namespace NED.GenericMessagingSystem
66
{
77
/// <summary>
88
/// Global message domain

Assets/Extensions/GenericMessagingSystem/Core/HandlerStorage.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
using System.Collections.Generic;
66

7-
namespace NED.GenericMessaingSystem
7+
namespace NED.GenericMessagingSystem
88
{
99
/// <summary>
1010
/// Class to message handler object
@@ -15,6 +15,14 @@ internal static class HandlerStorage<D, I> where D : IMessageDomain where I : IM
1515
{
1616
private static List<I> m_Handlers;
1717

18+
/// <summary>
19+
/// Get ready status of Handler
20+
/// </summary>
21+
public static bool IsReady
22+
{
23+
get { return (m_Handlers != null); }
24+
}
25+
1826
/// <summary>
1927
/// Get all handler collections
2028
/// </summary>

Assets/Extensions/GenericMessagingSystem/Core/IMessageDomain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// See the LICENSE file in the project root for more information.
33
// Created By Leo Pripos Marbun
44

5-
namespace NED.GenericMessaingSystem
5+
namespace NED.GenericMessagingSystem
66
{
77
/// <summary>
88
/// Base interface for message domain

Assets/Extensions/GenericMessagingSystem/Core/IMessageListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// See the LICENSE file in the project root for more information.
33
// Created By Leo Pripos Marbun
44

5-
namespace NED.GenericMessaingSystem
5+
namespace NED.GenericMessagingSystem
66
{
77
/// <summary>
88
/// Base interface for message listener

Assets/Extensions/GenericMessagingSystem/Sample/1-Debug/Scripts/GMSDebugMessageHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using UnityEngine;
22

3-
namespace NED.GenericMessaingSystem.Sample
3+
namespace NED.GenericMessagingSystem.Sample
44
{
55
public class GMSDebugMessageHandler : MonoBehaviour, GMSIDebugMessage
66
{
@@ -22,4 +22,4 @@ public void DebugMessage(string message)
2222
Debug.Log(message);
2323
}
2424
}
25-
}
25+
}

Assets/Extensions/GenericMessagingSystem/Sample/1-Debug/Scripts/GMSDebugMessageManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace NED.GenericMessaingSystem.Sample
1+
namespace NED.GenericMessagingSystem.Sample
22
{
33
public class GMSDebugMessageManager : BaseMessagingManager
44
{

Assets/Extensions/GenericMessagingSystem/Sample/1-Debug/Scripts/GMSDebugMessageSender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Diagnostics;
22
using UnityEngine;
33

4-
namespace NED.GenericMessaingSystem.Sample
4+
namespace NED.GenericMessagingSystem.Sample
55
{
66
public class GMSDebugMessageSender : MonoBehaviour
77
{

Assets/Extensions/GenericMessagingSystem/Sample/1-Debug/Scripts/GMSIDebugMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace NED.GenericMessaingSystem.Sample
1+
namespace NED.GenericMessagingSystem.Sample
22
{
33
public interface GMSIDebugMessage : IMessageListener
44
{

Assets/Extensions/GenericMessagingSystem/Sample/2-Tick/Scripts/GMSITickListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace NED.GenericMessaingSystem.Sample
1+
namespace NED.GenericMessagingSystem.Sample
22
{
33
public interface GMSITickListener : IMessageListener
44
{

Assets/Extensions/GenericMessagingSystem/Sample/2-Tick/Scripts/GMSTickManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using UnityEngine;
22

3-
namespace NED.GenericMessaingSystem.Sample
3+
namespace NED.GenericMessagingSystem.Sample
44
{
55
public sealed class GMSTickManager : BaseMessagingManager
66
{

Assets/Extensions/GenericMessagingSystem/Sample/2-Tick/Scripts/GMSTickText.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using UnityEngine;
22
using UnityEngine.UI;
33

4-
namespace NED.GenericMessaingSystem.Sample
4+
namespace NED.GenericMessagingSystem.Sample
55
{
66
[RequireComponent(typeof(Text))]
77
public class GMSTickText : MonoBehaviour, GMSITickListener

0 commit comments

Comments
 (0)