Skip to content

Commit 5e9761d

Browse files
committed
style: Match modern C# standard
1 parent 694e4bd commit 5e9761d

File tree

345 files changed

+3029
-2988
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+3029
-2988
lines changed

Assets/JCSUnity/Editor/JCSUnity_EditorWindow.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private void Init()
8686
return;
8787

8888
JCS_InputController.GAMEPAD_COUNT = EditorPrefs.GetInt(JCSUnity_EditortUtil.FormKey("GAMEPAD_COUNT"), 0);
89-
JCS_InputController.SelectGamepadType = EditorPrefs.GetInt(JCSUnity_EditortUtil.FormKey("SelectGamepadType"), 0);
89+
JCS_InputController.SELECT_GAMEPAD_TYPE = EditorPrefs.GetInt(JCSUnity_EditortUtil.FormKey("SelectGamepadType"), 0);
9090

9191
prefsLoaded = true;
9292
}
@@ -105,7 +105,7 @@ private void Draw()
105105
private void SavePref()
106106
{
107107
EditorPrefs.SetInt(JCSUnity_EditortUtil.FormKey("GAMEPAD_COUNT"), JCS_InputController.GAMEPAD_COUNT);
108-
EditorPrefs.SetInt(JCSUnity_EditortUtil.FormKey("SelectGamepadType"), JCS_InputController.SelectGamepadType);
108+
EditorPrefs.SetInt(JCSUnity_EditortUtil.FormKey("SelectGamepadType"), JCS_InputController.SELECT_GAMEPAD_TYPE);
109109
}
110110

111111
/// <summary>
@@ -229,7 +229,7 @@ private void Part_Input()
229229
{
230230
GUILayout.Label("Gamepad", EditorStyles.boldLabel);
231231

232-
JCS_InputController.SelectGamepadType = EditorGUILayout.Popup("Gamepad Type", JCS_InputController.SelectGamepadType, JCS_InputController.GamepadPlatform);
232+
JCS_InputController.SELECT_GAMEPAD_TYPE = EditorGUILayout.Popup("Gamepad Type", JCS_InputController.SELECT_GAMEPAD_TYPE, JCS_InputController.GAMEPAD_PLATFORM);
233233
JCS_InputController.GAMEPAD_COUNT = (int)EditorGUILayout.Slider("Gamepad Count", JCS_InputController.GAMEPAD_COUNT, 0, JCS_InputSettings.MAX_JOYSTICK_COUNT);
234234

235235
GUILayout.Label("Input Manager", EditorStyles.boldLabel);
@@ -669,10 +669,10 @@ private static void CreateSlidePanel()
669669
slideScreenCamera.name = "_SlideScreenCamera (Created)";
670670

671671
// set the panel holder.
672-
slideScreenCamera.PanelHolder = panelHolder9x9;
672+
slideScreenCamera.panelHolder = panelHolder9x9;
673673

674674
// set to default 2d.
675-
slideScreenCamera.UnityGUIType = JCS_UnityGUIType.uGUI_2D;
675+
slideScreenCamera.unityGUIType = JCS_UnityGUIType.uGUI_2D;
676676
}
677677

678678
/// <summary>

Assets/JCSUnity/Scripts/Actions/2D/AI/AIMoveAction/JCS_2DFlyAction.cs

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -156,35 +156,35 @@ public enum StatusY
156156

157157
/* Setter & Getter */
158158

159-
public CharacterController GetCharacterController() { return this.mCharacterControllerInfo.GetCharacterController(); }
160-
public Vector3 Velocity { get { return this.mVelocityInfo.Velocity; } set { this.mVelocityInfo.Velocity = value; } }
161-
public float VelX { get { return mVelocityInfo.VelX; } set { mVelocityInfo.VelX = value; } }
162-
public float VelY { get { return mVelocityInfo.VelY; } set { mVelocityInfo.VelY = value; } }
163-
public float VelZ { get { return mVelocityInfo.VelZ; } set { mVelocityInfo.VelZ = value; } }
164-
public bool isGrounded { get { return this.mCharacterControllerInfo.isGrounded; } }
165-
public Vector3 MoveSpeed { get { return mVelocityInfo.MoveSpeed; } set { mVelocityInfo.MoveSpeed = value; } }
166-
public Vector3 RecordSpeed { get { return mVelocityInfo.RecordSpeed; } set { mVelocityInfo.RecordSpeed = value; } }
159+
public CharacterController GetCharacterController() { return mCharacterControllerInfo.GetCharacterController(); }
160+
public Vector3 velocity { get { return mVelocityInfo.velocity; } set { mVelocityInfo.velocity = value; } }
161+
public float velX { get { return mVelocityInfo.velX; } set { mVelocityInfo.velX = value; } }
162+
public float velY { get { return mVelocityInfo.velY; } set { mVelocityInfo.velY = value; } }
163+
public float velZ { get { return mVelocityInfo.velZ; } set { mVelocityInfo.velZ = value; } }
164+
public bool isGrounded { get { return mCharacterControllerInfo.isGrounded; } }
165+
public Vector3 moveSpeed { get { return mVelocityInfo.moveSpeed; } set { mVelocityInfo.moveSpeed = value; } }
166+
public Vector3 recordSpeed { get { return mVelocityInfo.recordSpeed; } set { mVelocityInfo.recordSpeed = value; } }
167167

168-
public bool MadEffect { get { return this.mMadEffect; } set { this.mMadEffect = value; } }
168+
public bool madEffect { get { return mMadEffect; } set { mMadEffect = value; } }
169169

170-
public JCS_TimeType DeltaTimeType { get { return this.mTimeType; } set { this.mTimeType = value; } }
170+
public JCS_TimeType timeType { get { return mTimeType; } set { mTimeType = value; } }
171171

172172
/* Functions */
173173

174174
private void Awake()
175175
{
176-
this.mVelocityInfo = this.GetComponent<JCS_VelocityInfo>();
177-
this.mCharacterControllerInfo = this.GetComponent<JCS_CharacterControllerInfo>();
176+
mVelocityInfo = GetComponent<JCS_VelocityInfo>();
177+
mCharacterControllerInfo = GetComponent<JCS_CharacterControllerInfo>();
178178

179179
// try to get the sound
180180
if (mSoundPlayer == null)
181-
this.mSoundPlayer = this.GetComponent<JCS_SoundPlayer>();
181+
mSoundPlayer = GetComponent<JCS_SoundPlayer>();
182182

183183
// try to get the component in the same transform
184184
if (mAttackRecorder == null)
185-
mAttackRecorder = this.GetComponent<JCS_AttackerRecorder>();
185+
mAttackRecorder = GetComponent<JCS_AttackerRecorder>();
186186
if (mLiveObjectAnimator == null)
187-
mLiveObjectAnimator = this.GetComponent<JCS_2DLiveObjectAnimator>();
187+
mLiveObjectAnimator = GetComponent<JCS_2DLiveObjectAnimator>();
188188
}
189189

190190
private void Start()
@@ -193,26 +193,28 @@ private void Start()
193193

194194
// ignore all the tags.
195195
JCS_2DFlyActionIgnore[] tags = Resources.FindObjectsOfTypeAll<JCS_2DFlyActionIgnore>();
196+
196197
foreach (JCS_2DFlyActionIgnore tag in tags)
197198
{
198199
Physics.IgnoreCollision(tag.GetComponent<Collider>(),
199-
this.GetCharacterController());
200+
GetCharacterController());
200201
}
201202

202203
// ignore all platforms
203204
if (mIgnorePlatform)
204205
{
205206
// get all the paltform in the scene
206207
JCS_2DPositionPlatform[] platforms = Resources.FindObjectsOfTypeAll<JCS_2DPositionPlatform>();
208+
207209
foreach (JCS_2DPositionPlatform platform in platforms)
208210
{
209-
if (platform.CannotBeGoThrough)
211+
if (platform.cannotBeGoThrough)
210212
return;
211213

212214
Physics.IgnoreCollision(platform.GetPlatformCollider(),
213-
this.GetCharacterController());
215+
GetCharacterController());
214216
Physics.IgnoreCollision(platform.GetPlatformTrigger(),
215-
this.GetCharacterController());
217+
GetCharacterController());
216218
}
217219
}
218220
}
@@ -257,21 +259,21 @@ public void FlyDirectionByPossiblity()
257259
// if is already get attack do the mad effect.
258260
if (mMadEffect && mAttackRecorder != null)
259261
{
260-
Transform lastAttacker = mAttackRecorder.LastAttacker;
262+
Transform lastAttacker = mAttackRecorder.lastAttacker;
261263

262264
// if the last attacker does not exist, do nothing.
263265
if (lastAttacker != null)
264266
{
265267
// NOTE(JenChieh): if does exist, start following the attacker.
266268

267269
// X-axis
268-
if (lastAttacker.position.x < this.transform.position.x)
270+
if (lastAttacker.position.x < transform.position.x)
269271
directionX = StatusX.LEFT;
270272
else
271273
directionX = StatusX.RIGHT;
272274

273275
// Y-axis
274-
if (lastAttacker.position.y < this.transform.position.y)
276+
if (lastAttacker.position.y < transform.position.y)
275277
directionY = StatusY.DOWN;
276278
else
277279
directionY = StatusY.UP;
@@ -311,7 +313,6 @@ public void FlyDirectionByPossiblity()
311313
++resultCounterX;
312314
}
313315

314-
315316
float idlePossiblityY = JCS_Random.Range(0, 100);
316317
float upPossiblity = JCS_Random.Range(0, 100);
317318
float downPossiblity = JCS_Random.Range(0, 100);
@@ -422,7 +423,7 @@ public void FlyX()
422423
/// <param name="force"> foce to apply </param>
423424
public void FlyX(float force)
424425
{
425-
mVelocityInfo.RecordSpeedX = force;
426+
mVelocityInfo.recordSpeedX = force;
426427

427428
mFlyed = true;
428429
}
@@ -440,7 +441,7 @@ public void FlyY()
440441
/// <param name="force"> foce to apply </param>
441442
public void FlyY(float force)
442443
{
443-
mVelocityInfo.VelY = force;
444+
mVelocityInfo.velY = force;
444445

445446
mFlyed = true;
446447
}

Assets/JCSUnity/Scripts/Actions/2D/AI/AIMoveAction/JCS_2DJumpAction.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,19 @@ public class JCS_2DJumpAction : JCS_AIAction
9191
/* Setter & Getter */
9292

9393
// Info Variables
94-
public CharacterController GetCharacterController() { return this.mCharacterControllerInfo.GetCharacterController(); }
95-
public Vector3 Velocity { get { return this.mVelocityInfo.Velocity; } set { this.mVelocityInfo.Velocity = value; } }
96-
public float VelX { get { return mVelocityInfo.VelX; } set { mVelocityInfo.VelX = value; } }
97-
public float VelY { get { return mVelocityInfo.VelY; } set { mVelocityInfo.VelY = value; } }
98-
public float VelZ { get { return mVelocityInfo.VelZ; } set { mVelocityInfo.VelZ = value; } }
99-
public bool isGrounded { get { return this.mCharacterControllerInfo.isGrounded; } }
94+
public CharacterController GetCharacterController() { return mCharacterControllerInfo.GetCharacterController(); }
95+
public Vector3 velocity { get { return mVelocityInfo.velocity; } set { mVelocityInfo.velocity = value; } }
96+
public float velX { get { return mVelocityInfo.velX; } set { mVelocityInfo.velX = value; } }
97+
public float velY { get { return mVelocityInfo.velY; } set { mVelocityInfo.velY = value; } }
98+
public float velZ { get { return mVelocityInfo.velZ; } set { mVelocityInfo.velZ = value; } }
99+
public bool isGrounded { get { return mCharacterControllerInfo.isGrounded; } }
100100

101101
// Action Variables
102-
public float JumpForce { get { return this.mJumpForce; } set { this.mJumpForce = value; } }
103-
public float AdjustTime { get { return this.mAdjustTime; } set { this.mAdjustTime = value; } }
104-
public float Time { get { return this.mTime; } set { this.mTime = value; } }
105-
public float Possibility { get { return this.mPossibility; } set { this.mPossibility = value; } }
106-
public JCS_TimeType DeltaTimeType { get { return this.mTimeType; } set { this.mTimeType = value; } }
102+
public float jumpForce { get { return mJumpForce; } set { mJumpForce = value; } }
103+
public float adjustTime { get { return mAdjustTime; } set { mAdjustTime = value; } }
104+
public float time { get { return mTime; } set { mTime = value; } }
105+
public float possibility { get { return mPossibility; } set { mPossibility = value; } }
106+
public JCS_TimeType timeType { get { return mTimeType; } set { mTimeType = value; } }
107107

108108
/* Functions */
109109

@@ -167,7 +167,7 @@ public void Jump(float force)
167167
if (!isGrounded)
168168
return;
169169

170-
VelY = force;
170+
velY = force;
171171

172172
// record down the animation before do jump animation
173173
mAnimStateBeforeJump = mLiveObjectAnimator.GetCurrentAnimationState();

Assets/JCSUnity/Scripts/Actions/2D/AI/AIMoveAction/JCS_2DSwimAction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public class JCS_2DSwimAction : JCS_AIAction
2222

2323
private void Awake()
2424
{
25-
25+
// ..
2626
}
2727

2828
private void Update()
2929
{
30-
30+
// ..
3131
}
3232
}
3333
}

Assets/JCSUnity/Scripts/Actions/2D/AI/AIMoveAction/JCS_2DWalkAction.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -114,34 +114,34 @@ public enum Status
114114

115115
/* Setter & Getter */
116116

117-
public CharacterController GetCharacterController() { return this.mCharacterControllerInfo.GetCharacterController(); }
118-
public Vector3 Velocity { get { return this.mVelocityInfo.Velocity; } set { this.mVelocityInfo.Velocity = value; } }
119-
public float VelX { get { return mVelocityInfo.VelX; } set { mVelocityInfo.VelX = value; } }
120-
public float VelY { get { return mVelocityInfo.VelY; } set { mVelocityInfo.VelY = value; } }
121-
public float VelZ { get { return mVelocityInfo.VelZ; } set { mVelocityInfo.VelZ = value; } }
122-
public bool isGrounded { get { return this.mCharacterControllerInfo.isGrounded; } }
123-
public Vector3 MoveSpeed { get { return mVelocityInfo.MoveSpeed; } set { mVelocityInfo.MoveSpeed = value; } }
124-
public Vector3 RecordSpeed { get { return mVelocityInfo.RecordSpeed; } set { mVelocityInfo.RecordSpeed = value; } }
125-
public float RecordSpeedX { get { return this.mVelocityInfo.RecordSpeed.x; } set { this.mVelocityInfo.RecordSpeedX = value; } }
126-
public float RecordSpeedY { get { return this.mVelocityInfo.RecordSpeed.y; } set { this.mVelocityInfo.RecordSpeedY = value; } }
127-
public float RecordSpeedZ { get { return this.mVelocityInfo.RecordSpeed.z; } set { this.mVelocityInfo.RecordSpeedZ = value; } }
128-
public JCS_TimeType DeltaTimeType { get { return this.mTimeType; } set { this.mTimeType = value; } }
117+
public CharacterController GetCharacterController() { return mCharacterControllerInfo.GetCharacterController(); }
118+
public Vector3 velocity { get { return mVelocityInfo.velocity; } set { mVelocityInfo.velocity = value; } }
119+
public float velX { get { return mVelocityInfo.velX; } set { mVelocityInfo.velX = value; } }
120+
public float velY { get { return mVelocityInfo.velY; } set { mVelocityInfo.velY = value; } }
121+
public float velZ { get { return mVelocityInfo.velZ; } set { mVelocityInfo.velZ = value; } }
122+
public bool isGrounded { get { return mCharacterControllerInfo.isGrounded; } }
123+
public Vector3 moveSpeed { get { return mVelocityInfo.moveSpeed; } set { mVelocityInfo.moveSpeed = value; } }
124+
public Vector3 recordSpeed { get { return mVelocityInfo.recordSpeed; } set { mVelocityInfo.recordSpeed = value; } }
125+
public float recordSpeedX { get { return mVelocityInfo.recordSpeed.x; } set { mVelocityInfo.recordSpeedX = value; } }
126+
public float recordSpeedY { get { return mVelocityInfo.recordSpeed.y; } set { mVelocityInfo.recordSpeedY = value; } }
127+
public float recordSpeedZ { get { return mVelocityInfo.recordSpeed.z; } set { mVelocityInfo.recordSpeedZ = value; } }
128+
public JCS_TimeType timeType { get { return mTimeType; } set { mTimeType = value; } }
129129

130130
// Track Effects
131-
public bool MadEffect { get { return this.mMadEffect; } set { this.mMadEffect = value; } }
131+
public bool madEffect { get { return mMadEffect; } set { mMadEffect = value; } }
132132

133133
/* Functions */
134134

135135
private void Awake()
136136
{
137-
mVelocityInfo = this.GetComponent<JCS_VelocityInfo>();
138-
mCharacterControllerInfo = this.GetComponent<JCS_CharacterControllerInfo>();
137+
mVelocityInfo = GetComponent<JCS_VelocityInfo>();
138+
mCharacterControllerInfo = GetComponent<JCS_CharacterControllerInfo>();
139139

140140
// try to get the component in the same transform
141141
if (mAttackRecorder == null)
142-
mAttackRecorder = this.GetComponent<JCS_AttackerRecorder>();
142+
mAttackRecorder = GetComponent<JCS_AttackerRecorder>();
143143
if (mLiveObjectAnimator == null)
144-
mLiveObjectAnimator = this.GetComponent<JCS_2DLiveObjectAnimator>();
144+
mLiveObjectAnimator = GetComponent<JCS_2DLiveObjectAnimator>();
145145
}
146146

147147
private void Start()
@@ -186,7 +186,7 @@ public void WalkDirectionPossibility()
186186
// if is already get attack do the mad effect.
187187
if (mMadEffect && mAttackRecorder != null)
188188
{
189-
Transform lastAttacker = mAttackRecorder.LastAttacker;
189+
Transform lastAttacker = mAttackRecorder.lastAttacker;
190190

191191
// if the last attacker does not exist, do nothing.
192192
if (lastAttacker != null)
@@ -320,7 +320,7 @@ public void Walk(float speed)
320320
if (!isGrounded)
321321
return;
322322

323-
RecordSpeedX = speed;
323+
recordSpeedX = speed;
324324

325325
mWalked = true;
326326
}

Assets/JCSUnity/Scripts/Actions/2D/AI/JCS_2DAIStateSystem.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ public enum JCS_AIMoveActionType
4343

4444
/* Setter & Getter */
4545

46-
public JCS_AIMoveActionType GetAIMoveActionType() { return this.mAIMoveActionType; }
46+
public JCS_AIMoveActionType GetAIMoveActionType() { return mAIMoveActionType; }
4747

4848
/* Functions */
4949

5050
private void Awake()
5151
{
52-
this.mAIActions = new JCS_Vec<JCS_AIAction>();
52+
mAIActions = new JCS_Vec<JCS_AIAction>();
5353

5454
// add all the ai action into the array.
55-
JCS_AIAction[] actions = this.GetComponents<JCS_AIAction>();
55+
JCS_AIAction[] actions = GetComponents<JCS_AIAction>();
5656
for (int index = 0; index < actions.Length; ++index)
5757
{
5858
mAIActions.push(actions[index]);
@@ -85,11 +85,11 @@ public void SwitchAIMoveState(JCS_AIMoveActionType type)
8585
case JCS_AIMoveActionType.WALK:
8686
{
8787
// try to get the component on this transform.
88-
JCS_2DWalkAction wa = this.GetComponent<JCS_2DWalkAction>();
88+
JCS_2DWalkAction wa = GetComponent<JCS_2DWalkAction>();
8989
if (wa == null) // if nothing here.
9090
{
9191
// add it on to it
92-
wa = this.gameObject.AddComponent<JCS_2DWalkAction>();
92+
wa = gameObject.AddComponent<JCS_2DWalkAction>();
9393

9494
// and push into array.
9595
mAIActions.push(wa);
@@ -104,10 +104,10 @@ public void SwitchAIMoveState(JCS_AIMoveActionType type)
104104
break;
105105
case JCS_AIMoveActionType.JUMP:
106106
{
107-
JCS_2DJumpAction ja = this.GetComponent<JCS_2DJumpAction>();
107+
JCS_2DJumpAction ja = GetComponent<JCS_2DJumpAction>();
108108
if (ja == null)
109109
{
110-
ja = this.gameObject.AddComponent<JCS_2DJumpAction>();
110+
ja = gameObject.AddComponent<JCS_2DJumpAction>();
111111
mAIActions.push(ja);
112112
}
113113
DisableActions();
@@ -116,10 +116,10 @@ public void SwitchAIMoveState(JCS_AIMoveActionType type)
116116
break;
117117
case JCS_AIMoveActionType.FLY:
118118
{
119-
JCS_2DFlyAction fa = this.GetComponent<JCS_2DFlyAction>();
119+
JCS_2DFlyAction fa = GetComponent<JCS_2DFlyAction>();
120120
if (fa == null)
121121
{
122-
fa = this.gameObject.AddComponent<JCS_2DFlyAction>();
122+
fa = gameObject.AddComponent<JCS_2DFlyAction>();
123123
mAIActions.push(fa);
124124
}
125125
DisableActions();
@@ -128,10 +128,10 @@ public void SwitchAIMoveState(JCS_AIMoveActionType type)
128128
break;
129129
case JCS_AIMoveActionType.SWIM:
130130
{
131-
JCS_2DSwimAction sa = this.GetComponent<JCS_2DSwimAction>();
131+
JCS_2DSwimAction sa = GetComponent<JCS_2DSwimAction>();
132132
if (sa == null)
133133
{
134-
sa = this.gameObject.AddComponent<JCS_2DSwimAction>();
134+
sa = gameObject.AddComponent<JCS_2DSwimAction>();
135135
mAIActions.push(sa);
136136
}
137137
DisableActions();
@@ -140,7 +140,7 @@ public void SwitchAIMoveState(JCS_AIMoveActionType type)
140140
break;
141141
}
142142

143-
this.mAIMoveActionType = type;
143+
mAIMoveActionType = type;
144144
}
145145

146146
/// <summary>

0 commit comments

Comments
 (0)