Skip to content

Commit d54115f

Browse files
committed
feat: Make IGL singleton
1 parent 3ea531c commit d54115f

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

Assets/JCSUnity/Scripts/Managers/JCS_UtilManager.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ public class JCS_UtilManager : JCS_Manager<JCS_UtilManager>
2525
[ReadOnly]
2626
private JCS_MixDamageTextPool mMixDamageTextPool = null;
2727

28-
[Tooltip("In Game Log System util.")]
29-
[SerializeField]
30-
[ReadOnly]
31-
private JCS_IGLogSystem mIGLogSystem = null;
32-
3328
[Separator("Initialize Variables (JCS_UtilManager)")]
3429

3530
[Tooltip("Trasnparent sprite.")]
@@ -38,14 +33,11 @@ public class JCS_UtilManager : JCS_Manager<JCS_UtilManager>
3833

3934
/* Setter & Getter */
4035

36+
public Sprite SpriteTransparent { get { return this.mSpriteTransparent; } }
37+
4138
public void SetMixDamageTextPool(JCS_MixDamageTextPool tp) { this.mMixDamageTextPool = tp; }
4239
public JCS_MixDamageTextPool GetMixDamageTextPool() { return this.mMixDamageTextPool; }
4340

44-
public void SetIGLogSystem(JCS_IGLogSystem sys) { this.mIGLogSystem = sys; }
45-
public JCS_IGLogSystem GetIGLogSystem() { return this.mIGLogSystem; }
46-
47-
public Sprite SpriteTransparent { get { return this.mSpriteTransparent; } }
48-
4941
/* Functions */
5042

5143
private void Awake()

Assets/JCSUnity/Scripts/UI/InGameLogSystem/JCS_IGLogSystem.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public class JCS_IGLogSystem : JCS_UnityObject
2020
{
2121
/* Variables */
2222

23+
public static JCS_IGLogSystem instance = null;
24+
2325
private JCS_GUITextPool mLogTextPool = null;
2426

2527
#if UNITY_EDITOR
@@ -61,17 +63,13 @@ protected override void Awake()
6163
{
6264
base.Awake();
6365

66+
instance = this;
67+
6468
this.mLogTextPool = this.GetComponent<JCS_GUITextPool>();
6569

6670
mRenderLogText = new JCS_Vec<JCS_LogText>();
6771
}
6872

69-
private void Start()
70-
{
71-
// set to utility manager.
72-
JCS_UtilManager.instance.SetIGLogSystem(this);
73-
}
74-
7573
#if UNITY_EDITOR
7674
private void Update()
7775
{

Assets/_BossFight/Scripts/BF_LiveObject.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ public override void Die()
9494
// minus monster count.
9595
--bggm.MOB_CURRENT_IN_SCENE;
9696

97-
var utilm = JCS_UtilManager.instance;
98-
if (utilm.GetIGLogSystem() != null)
97+
var igls = JCS_IGLogSystem.instance;
98+
99+
if (igls != null)
99100
{
100101
string expMsg = BF_MessageSettings.instance.EXP_BASE + EXP.ToString();
101102

102-
utilm.GetIGLogSystem().SendLogMessage(expMsg);
103+
igls.SendLogMessage(expMsg);
103104
}
104105

105106
base.Die();

0 commit comments

Comments
 (0)