Skip to content

Commit

Permalink
feat(Manager): Rename some game initialize variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Nov 2, 2024
1 parent 8a6090a commit 1685e18
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
18 changes: 9 additions & 9 deletions Assets/JCSUnity/Scripts/Managers/JCS_GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ public class JCS_GameManager : JCS_Manager<JCS_GameManager>
/* Variables */

// Callback after the game is done initialize.
public EmptyFunction afterGameInitializeCallback = null;
public EmptyFunction onAfterInitialize = null;

[Separator("Check Variable (JCS_GameManager)")]

[Tooltip("Is game done initialize?")]
[SerializeField]
[ReadOnly]
private bool mGameDoneInitialize = false;
private bool mDoneInitialize = false;

private JCS_Player mPlayer = null;

/* Setter & Getter */

public bool GAME_DONE_INITIALIZE { get { return this.mGameDoneInitialize; } }
public bool DONE_INITIALIZE { get { return this.mDoneInitialize; } }
public bool GAME_PAUSE
{
get { return JCS_PauseManager.instance.Paused; }
Expand Down Expand Up @@ -66,7 +66,7 @@ private void Awake()

private void Update()
{
SetGameDoneInitializeFlag();
SetDoneInitializeFlag();
}

/// <summary>
Expand All @@ -87,15 +87,15 @@ private void SetSpecificGameTypeGameManager()
/// <summary>
/// Set the game done initialize flag.
/// </summary>
private void SetGameDoneInitializeFlag()
private void SetDoneInitializeFlag()
{
if (this.mGameDoneInitialize)
if (this.mDoneInitialize)
return;

this.mGameDoneInitialize = true;
this.mDoneInitialize = true;

if (afterGameInitializeCallback != null)
afterGameInitializeCallback.Invoke();
if (onAfterInitialize != null)
onAfterInitialize.Invoke();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/JCSUnity/Scripts/Settings/JCS_AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void Start()
{
// If already starts we don't need to enable the flag.
if (!APPLICATION_STARTS)
JCS_GameManager.instance.afterGameInitializeCallback += DoApplicationStart;
JCS_GameManager.instance.onAfterInitialize += DoApplicationStart;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Assets/JCSUnity/Scripts/UI/Dialogue/JCS_DialogueSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ public void Dispose()
mActiveThisFrame = false;

// Check initialize to ignore dispose called at the very beginning!
if (JCS_GameManager.instance.GAME_DONE_INITIALIZE && onDispose != null)
if (JCS_GameManager.instance.DONE_INITIALIZE && onDispose != null)
onDispose.Invoke();

// Play the dispose dialogue sound.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private void Start()
{
JCS_GameManager gm = JCS_GameManager.instance;

gm.afterGameInitializeCallback += RecordPrevData;
gm.onAfterInitialize += RecordPrevData;
}
}

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
> Released N/A
* feat(Effects): Add Shader Tweener (a82baff87c87c18839b60a6a36363dbf4524ff3b)
* feat(UI): Add progress on hidden option to dialogue system (8a6090a10c832f9ffc62376351d7eb32767e32dd)

## 3.0.0
> Released Oct 15, 2024
Expand Down
11 changes: 6 additions & 5 deletions docs/ScriptReference/Managers/JCS_GameManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Manager that manage the game behaviour.

## Variables

| Name | Description |
|:---------------------|:-------------------------------|
| TIME_SCALE | Adjustable current time scale" |
| GAME_PAUSE | Is the game pause? |
| GAME_DONE_INITIALIZE | Is game done initialize? |
| Name | Description |
|:------------------|:--------------------------------------------|
| onAfterInitialize | Callback after the game is done initialize. |
| TIME_SCALE | Adjustable current time scale. |
| GAME_PAUSE | Is the game pause? |
| DONE_INITIALIZE | Is game done initialize? |

0 comments on commit 1685e18

Please sign in to comment.