Skip to content

Commit 297779f

Browse files
committed
refactor: More clean up
1 parent 4230a8c commit 297779f

File tree

19 files changed

+55
-738
lines changed

19 files changed

+55
-738
lines changed

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

Lines changed: 0 additions & 544 deletions
This file was deleted.

Assets/JCSUnity/Scripts/Actions/2D/AI/JCS_2DInitLookByTypeAction.cs.meta

Lines changed: 0 additions & 12 deletions
This file was deleted.

Assets/JCSUnity/Scripts/Interactive/2D/Camera/JCS_2DCamera.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected override void Start()
134134
// Use player from "JCS_GameManager" as default
135135
if (mTargetTransform == null)
136136
{
137-
JCS_Player player = JCS_GameManager.FirstInstance().Player;
137+
JCS_Player player = JCS_GameManager.FirstInstance().player;
138138
if (player != null)
139139
SetFollowTarget(player.transform);
140140
}

Assets/JCSUnity/Scripts/Interactive/2D/GameObjects/JCS_2DBullet.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ public class JCS_2DBullet : JCS_Bullet
120120
// timer in order to know when to do the effect.
121121
private float mLookTimer = 0;
122122

123-
[Tooltip("If this effect is active plz attach.")]
124-
[SerializeField]
125-
private JCS_2DInitLookByTypeAction mInitLookAction = null;
126-
127123
/* Setter & Getter */
128124

129125
public override float moveSpeed
@@ -152,9 +148,6 @@ protected override void Awake()
152148
if (mRandomAbsorbTime != 0)
153149
mTimeToAbsorb += JCS_Random.Range(-mRandomAbsorbTime, mRandomAbsorbTime);
154150

155-
if (mInitLookAction == null)
156-
mInitLookAction = this.GetComponent<JCS_2DInitLookByTypeAction>();
157-
158151
if (mRandomTimeToLook != 0)
159152
mTimeToLook += JCS_Random.Range(-mRandomTimeToLook, mRandomTimeToLook);
160153
}
@@ -252,9 +245,6 @@ private void DoInitLookByTypeEffect()
252245
if (!mInitLookByTypeAction)
253246
return;
254247

255-
if (mInitLookAction == null)
256-
return;
257-
258248
mLookTimer += JCS_Time.ItTime(mTimeType);
259249

260250
if (mLookTimer < mTimeToLook)
@@ -263,8 +253,6 @@ private void DoInitLookByTypeEffect()
263253
// count once
264254
++mContinousLookCounter;
265255

266-
mInitLookAction.LockOnInit();
267-
268256
// reset timer.
269257
mLookTimer = 0;
270258

Assets/JCSUnity/Scripts/Interactive/2D/JCS_2DPlatform.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected virtual void Start()
4444

4545
protected virtual void OnTriggerEnter(Collider other)
4646
{
47-
JCS_Player player = JCS_GameManager.FirstInstance().Player;
47+
JCS_Player player = JCS_GameManager.FirstInstance().player;
4848
if (player == null)
4949
return;
5050

@@ -58,7 +58,7 @@ protected virtual void OnTriggerEnter(Collider other)
5858

5959
protected virtual void OnTriggerExit(Collider other)
6060
{
61-
JCS_Player player = JCS_GameManager.FirstInstance().Player;
61+
JCS_Player player = JCS_GameManager.FirstInstance().player;
6262
if (player == null)
6363
return;
6464

Assets/JCSUnity/Scripts/Interfaces/JCS_Player.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected virtual void Awake()
6565
protected virtual void Start()
6666
{
6767
// set Execute order lower than "JCS_GameManager"
68-
JCS_GameManager.FirstInstance().Player = this;
68+
JCS_GameManager.FirstInstance().player = this;
6969

7070
// Player Manager will take care of all the player
7171
JCS_PlayerManager.FirstInstance().AddPlayerToManage(this);

Assets/JCSUnity/Scripts/Managers/2D/JCS_2DGameManager.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* $Notice: See LICENSE.txt for modification and distribution information
77
* Copyright (c) 2016 by Shen, Jen-Chieh $
88
*/
9+
using MyBox;
910
using System.Collections.Generic;
1011
using UnityEngine;
1112

@@ -18,8 +19,11 @@ public class JCS_2DGameManager : JCS_Manager<JCS_2DGameManager>
1819
{
1920
/* Variables */
2021

21-
// a list of item object will ignore their collision detection.
22-
private List<JCS_2DPositionPlatform> mPlatformList = null;
22+
[Separator("Check Variables (JCS_2DGameManager)")]
23+
24+
[Tooltip("A list of item object will ignore their collision detection.")]
25+
[SerializeField]
26+
private List<JCS_2DPositionPlatform> mPlatforms = null;
2327

2428
/* Setter & Getter */
2529

@@ -28,8 +32,6 @@ public class JCS_2DGameManager : JCS_Manager<JCS_2DGameManager>
2832
private void Awake()
2933
{
3034
RegisterInstance(this);
31-
32-
mPlatformList = new List<JCS_2DPositionPlatform>();
3335
}
3436

3537
/// <summary>
@@ -38,7 +40,7 @@ private void Awake()
3840
/// <param name="pp"></param>
3941
public void AddPlatformList(JCS_2DPositionPlatform pp)
4042
{
41-
mPlatformList.Add(pp);
43+
mPlatforms.Add(pp);
4244
}
4345

4446
/// <summary>
@@ -47,9 +49,9 @@ public void AddPlatformList(JCS_2DPositionPlatform pp)
4749
/// <param name="c"> collder to set to ignore trigger. </param>
4850
public void IgnoreAllPlatformTrigger(Collider c)
4951
{
50-
for (int index = 0; index < mPlatformList.Count; ++index)
52+
for (int index = 0; index < mPlatforms.Count; ++index)
5153
{
52-
Physics.IgnoreCollision(mPlatformList[index].GetPlatformTrigger(),
54+
Physics.IgnoreCollision(mPlatforms[index].GetPlatformTrigger(),
5355
c, true);
5456
}
5557
}
@@ -60,9 +62,9 @@ public void IgnoreAllPlatformTrigger(Collider c)
6062
/// <param name="c"> collider to set to ignore collider. </param>
6163
public void IgnoreAllPlatformCollider(Collider c)
6264
{
63-
for (int index = 0; index < mPlatformList.Count; ++index)
65+
for (int index = 0; index < mPlatforms.Count; ++index)
6466
{
65-
Physics.IgnoreCollision(mPlatformList[index].GetPlatformCollider(),
67+
Physics.IgnoreCollision(mPlatforms[index].GetPlatformCollider(),
6668
c, true);
6769
}
6870
}

Assets/JCSUnity/Scripts/Managers/2D/JCS_2DLiveObjectManager.cs

Lines changed: 0 additions & 73 deletions
This file was deleted.

Assets/JCSUnity/Scripts/Managers/2D/JCS_2DLiveObjectManager.cs.meta

Lines changed: 0 additions & 12 deletions
This file was deleted.

Assets/JCSUnity/Scripts/Managers/3D/JCS_3DWalkActionManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public JCS_3DWalkAction OverlapWithOthers(JCS_3DWalkAction self, Vector3 targetP
7070
if (distance <= overlapDistance)
7171
return wa;
7272
}
73+
7374
return null;
7475
}
7576
}

0 commit comments

Comments
 (0)