Skip to content

Commit

Permalink
chore: Rename from game constant to contants
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 24, 2024
1 parent 8d834c6 commit 3b06ab7
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Assets/JCSUnity/Scripts/Actions/3D/JCS_3DThrowAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void Update()
float dt = JCS_Time.DeltaTime(mDeltaTimeType);

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

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

mVelocity.x = displacement.x / time;
mVelocity.z = displacement.z / time;
mVelocity.y = (displacement.y - (-JCS_GameConstant.GRAVITY * mGravityProduct * time * time / 2)) / time;
mVelocity.y = (displacement.y - (JCS_Constants.GRAVITY * mGravityProduct * time * time / 2)) / time;

// start dropping.
this.mActive = true;
Expand Down
2 changes: 1 addition & 1 deletion Assets/JCSUnity/Scripts/Effects/Item/JCS_OneJump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void FixedUpdate()
float dt = JCS_Time.DeltaTime(mDeltaTimeType);

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

private void OnTriggerEnter(Collider other)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ private void CharacterNormal()
if (!isGrounded())
{
// apply gravity
mVelocity.y -= (JCS_GameConstant.GRAVITY *
mVelocity.y += (JCS_Constants.GRAVITY *
JCS_Time.DeltaTime(mDeltaTimeType) *
JCS_GameSettings.instance.GRAVITY_PRODUCT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ private void ApplyGravity()
if (!isGrounded())
{
// apply gravity
mVelocity.y += -JCS_GameConstant.GRAVITY * JCS_Time.DeltaTime(mDeltaTimeType);
mVelocity.y += JCS_Constants.GRAVITY * JCS_Time.DeltaTime(mDeltaTimeType);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/JCSUnity/Scripts/GameObject/3D/JCS_3DPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected override void Update()
protected override void FixedUpdate()
{
if (!mCharacterController.isGrounded)
mVelocity.y -= (JCS_GameConstant.GRAVITY * JCS_Time.DeltaTime(mDeltaTimeType) * JCS_GameSettings.instance.GRAVITY_PRODUCT);
mVelocity.y += (JCS_Constants.GRAVITY * JCS_Time.DeltaTime(mDeltaTimeType) * JCS_GameSettings.instance.GRAVITY_PRODUCT);

base.FixedUpdate();
}
Expand Down
4 changes: 2 additions & 2 deletions Assets/JCSUnity/Scripts/Info/JCS_VelocityInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ private void FixedUpdate()
{
if (!isGrounded)
{
VelY -=
JCS_GameConstant.GRAVITY *
VelY +=
JCS_Constants.GRAVITY *
dt *
JCS_GameSettings.instance.GRAVITY_PRODUCT;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* $File: JCS_GameConstant.cs $
* $File: JCS_Constants.cs $
* $Date: $
* $Revision: $
* $Creator: Jen-Chieh Shen $
Expand All @@ -12,9 +12,9 @@ namespace JCSUnity
/// <summary>
/// Hold all the game constant here.
/// </summary>
public static class JCS_GameConstant
public static class JCS_Constants
{
public static float GRAVITY = 9.81f;
public static float GRAVITY = -9.81f;

}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# JCS_GameConstant
# JCS_Constants

Place general game constant here.

0 comments on commit 3b06ab7

Please sign in to comment.