Skip to content

Commit

Permalink
add ezy socket config holder (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
vu-luong authored Jul 15, 2023
1 parent c5b1f3e commit c4a91f0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions unity/EzyDefaultController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace com.tvd12.ezyfoxserver.client.unity
public class EzyDefaultController : MonoBehaviour
{
[SerializeField]
private EzySocketConfigHolderVariable socketConfigHolderVariable;
protected EzySocketConfigVariable socketConfigVariable;
protected EzySocketProxy socketProxy;
protected EzyAppProxy appProxy;
Expand All @@ -23,6 +24,7 @@ public class EzyDefaultController : MonoBehaviour
protected void OnEnable()
{
LOGGER.debug("OnEnable");
socketConfigVariable = socketConfigHolderVariable.Value;
var socketProxyManager = EzySocketProxyManager.getInstance();
if (!socketProxyManager.hasInited())
{
Expand Down
4 changes: 2 additions & 2 deletions unity/EzyEventProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class EzyEventProcessor : MonoBehaviour
private static EzyEventProcessor INSTANCE;

[SerializeField]
private EzySocketConfigVariable socketConfig;
private EzySocketConfigHolderVariable socketConfig;

private void Awake()
{
Expand All @@ -29,7 +29,7 @@ void Update()
#if UNITY_WEBGL && !UNITY_EDITOR
#else
EzyClients.getInstance()
.getClient(socketConfig.Value.ZoneName)
.getClient(socketConfig.Value.Value.ZoneName)
.processEvents();
#endif
}
Expand Down
9 changes: 9 additions & 0 deletions unity/variable/EzySocketConfigHolderVariable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using UnityEngine;

namespace com.tvd12.ezyfoxserver.client.unity
{
[CreateAssetMenu]
public class EzySocketConfigHolderVariable : EzyScriptableVariable<EzySocketConfigVariable>
{
}
}

0 comments on commit c4a91f0

Please sign in to comment.