Skip to content

Commit 3b06ab7

Browse files
committed
chore: Rename from game constant to contants
1 parent 8d834c6 commit 3b06ab7

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

Assets/JCSUnity/Scripts/Actions/3D/JCS_3DThrowAction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ private void Update()
8787
float dt = JCS_Time.DeltaTime(mDeltaTimeType);
8888

8989
// make it effect by gravity.
90-
this.mVelocity.y += -JCS_GameConstant.GRAVITY * mGravityProduct * dt;
90+
this.mVelocity.y += JCS_Constants.GRAVITY * mGravityProduct * dt;
9191

9292
// add up velocity.
9393
this.transform.position += mVelocity * dt;
@@ -126,7 +126,7 @@ public void ThrowByTime(Vector3 targetPos, float time)
126126

127127
mVelocity.x = displacement.x / time;
128128
mVelocity.z = displacement.z / time;
129-
mVelocity.y = (displacement.y - (-JCS_GameConstant.GRAVITY * mGravityProduct * time * time / 2)) / time;
129+
mVelocity.y = (displacement.y - (JCS_Constants.GRAVITY * mGravityProduct * time * time / 2)) / time;
130130

131131
// start dropping.
132132
this.mActive = true;

Assets/JCSUnity/Scripts/Effects/Item/JCS_OneJump.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private void FixedUpdate()
104104
float dt = JCS_Time.DeltaTime(mDeltaTimeType);
105105

106106
this.transform.position += mVelocity * dt;
107-
mVelocity.y += -JCS_GameConstant.GRAVITY * dt * mItemGravity;
107+
mVelocity.y += JCS_Constants.GRAVITY * dt * mItemGravity;
108108
}
109109

110110
private void OnTriggerEnter(Collider other)

Assets/JCSUnity/Scripts/GameObject/2D/2DPlayer/JCS_2DSideScrollerPlayer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ private void CharacterNormal()
864864
if (!isGrounded())
865865
{
866866
// apply gravity
867-
mVelocity.y -= (JCS_GameConstant.GRAVITY *
867+
mVelocity.y += (JCS_Constants.GRAVITY *
868868
JCS_Time.DeltaTime(mDeltaTimeType) *
869869
JCS_GameSettings.instance.GRAVITY_PRODUCT);
870870

Assets/JCSUnity/Scripts/GameObject/2DEngine/JCS_CharacterController2D.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ private void ApplyGravity()
705705
if (!isGrounded())
706706
{
707707
// apply gravity
708-
mVelocity.y += -JCS_GameConstant.GRAVITY * JCS_Time.DeltaTime(mDeltaTimeType);
708+
mVelocity.y += JCS_Constants.GRAVITY * JCS_Time.DeltaTime(mDeltaTimeType);
709709
}
710710
else
711711
{

Assets/JCSUnity/Scripts/GameObject/3D/JCS_3DPlayer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected override void Update()
4242
protected override void FixedUpdate()
4343
{
4444
if (!mCharacterController.isGrounded)
45-
mVelocity.y -= (JCS_GameConstant.GRAVITY * JCS_Time.DeltaTime(mDeltaTimeType) * JCS_GameSettings.instance.GRAVITY_PRODUCT);
45+
mVelocity.y += (JCS_Constants.GRAVITY * JCS_Time.DeltaTime(mDeltaTimeType) * JCS_GameSettings.instance.GRAVITY_PRODUCT);
4646

4747
base.FixedUpdate();
4848
}

Assets/JCSUnity/Scripts/Info/JCS_VelocityInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ private void FixedUpdate()
117117
{
118118
if (!isGrounded)
119119
{
120-
VelY -=
121-
JCS_GameConstant.GRAVITY *
120+
VelY +=
121+
JCS_Constants.GRAVITY *
122122
dt *
123123
JCS_GameSettings.instance.GRAVITY_PRODUCT;
124124
}

Assets/JCSUnity/Scripts/JCS_GameConstant.cs renamed to Assets/JCSUnity/Scripts/JCS_Constants.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* $File: JCS_GameConstant.cs $
2+
* $File: JCS_Constants.cs $
33
* $Date: $
44
* $Revision: $
55
* $Creator: Jen-Chieh Shen $
@@ -12,9 +12,9 @@ namespace JCSUnity
1212
/// <summary>
1313
/// Hold all the game constant here.
1414
/// </summary>
15-
public static class JCS_GameConstant
15+
public static class JCS_Constants
1616
{
17-
public static float GRAVITY = 9.81f;
17+
public static float GRAVITY = -9.81f;
1818

1919
}
2020
}
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# JCS_GameConstant
1+
# JCS_Constants
22

33
Place general game constant here.

0 commit comments

Comments
 (0)