Skip to content

Commit a5b15bc

Browse files
committed
Update mix damage text module.
1 parent a64ea5a commit a5b15bc

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

Assets/JCSUnity/Scripts/GUI/JCS_Canvas.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class JCS_Canvas
2626

2727
private static string RESIZE_UI_PATH = "JCSUnity_Resources/LevelDesignUI/ResizeUI";
2828

29-
3029
[Header("** Check Variables (JCS_Canvas) **")]
3130

3231
[Tooltip("Canvas object.")]
@@ -40,15 +39,13 @@ public class JCS_Canvas
4039
// Application Rect (Window)
4140
private RectTransform mAppRect = null;
4241

43-
4442
/* Setter & Getter */
4543

4644
public RectTransform GetAppRect() { return this.mAppRect; }
4745
public Canvas GetCanvas() { return this.mCanvas; }
4846
public void SetResizeUI(JCS_ResizeUI ui) { this.mResizeUI = ui; }
4947
public JCS_ResizeUI GetResizeUI() { return this.mResizeUI; }
5048

51-
5249
/* Functions */
5350

5451
private void Awake()
@@ -64,9 +61,7 @@ private void Awake()
6461

6562
Transform tempTrans = instance.transform;
6663
// so record all the transform
67-
for (int index = 0;
68-
index < tempTrans.childCount;
69-
++index)
64+
for (int index = 0; index < tempTrans.childCount; ++index)
7065
{
7166
Transform child = tempTrans.GetChild(index);
7267
if (child.name == black_screen_name ||

Assets/JCSUnity/Scripts/GUI/Text/JCS_MixDamageTextPool.cs

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ public enum DamageTextType
106106

107107
/* Setter & Getter */
108108

109-
private JCS_DamageTextPool GetCriticalDamageTextPool() { return this.mCritDamageTextPool; }
110-
private JCS_DamageTextPool GetNormralDamageTextPool() { return this.mNormalDamageTextPool; }
111-
private JCS_DamageTextPool GetGetDamageDamageTextPool() { return this.mGetDamageDamageTextPool; }
112-
private JCS_DamageTextPool GetHealDamageTextPoll() { return this.mHealDamageTextPool; }
109+
public JCS_DamageTextPool CriticalDamageTextPool { get { return this.mCritDamageTextPool; } }
110+
public JCS_DamageTextPool NormralDamageTextPool { get { return this.mNormalDamageTextPool; } }
111+
public JCS_DamageTextPool GetDamageDamageTextPool { get { return this.mGetDamageDamageTextPool; } }
112+
public JCS_DamageTextPool HealDamageTextPoll { get { return this.mHealDamageTextPool; } }
113113

114114
/* Functions */
115115

@@ -375,14 +375,27 @@ public int[] DamageTextSpawnerSimple(
375375
public void SpawnDamageTextFromPoolByType(
376376
int damage,
377377
Vector3 pos,
378-
AudioClip hitSound,
379-
DamageTextType type = DamageTextType.NORMAL)
378+
DamageTextType type = DamageTextType.NORMAL,
379+
AudioClip hitSound = null)
380380
{
381381
JCS_DamageTextPool dtp = GetDamageTextPoolByType(type);
382382

383383
if (dtp != null)
384384
dtp.SpawnDamageTextFromPool(damage, pos, hitSound);
385385
}
386+
public void SpawnDamageTextsFromPoolByType(
387+
int[] damage,
388+
Vector3 pos,
389+
DamageTextType type,
390+
AudioClip hitSound = null)
391+
{
392+
DamageTextType[] types = new DamageTextType[damage.Length];
393+
394+
for (int index = 0; index < types.Length; ++index)
395+
types[index] = type;
396+
397+
SpawnDamageTextsFromPoolByType(damage, pos, types, hitSound);
398+
}
386399
public void SpawnDamageTextsFromPoolByType(
387400
int[] damage,
388401
Vector3 pos,
@@ -447,13 +460,13 @@ private JCS_DamageTextPool GetDamageTextPoolByType(DamageTextType type)
447460
switch (type)
448461
{
449462
case DamageTextType.NORMAL:
450-
return this.GetNormralDamageTextPool();
463+
return this.NormralDamageTextPool;
451464
case DamageTextType.CRITICAL:
452-
return this.GetCriticalDamageTextPool();
465+
return this.CriticalDamageTextPool;
453466
case DamageTextType.GET_DAMAGE:
454-
return this.GetGetDamageDamageTextPool();
467+
return this.GetDamageDamageTextPool;
455468
case DamageTextType.HEAL:
456-
return this.GetHealDamageTextPoll();
469+
return this.HealDamageTextPoll;
457470
}
458471
return null;
459472
}
@@ -488,7 +501,7 @@ private void Sequence(
488501
}
489502

490503
// spawn that specific damage text!
491-
SpawnDamageTextFromPoolByType(damage[count], pos[count], hitSound, types[count]);
504+
SpawnDamageTextFromPoolByType(damage[count], pos[count], types[count], hitSound);
492505

493506
++count;
494507
// Update new count, in order to spawn next damage text.

Assets/JCSUnity/Scripts/JCS_Camera.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public abstract class JCS_Camera
9191
public bool Following { get { return this.mFollowing; } set { this.mFollowing = value; } }
9292
public bool SmoothTrack { get { return this.mSmoothTrack; } set { this.mSmoothTrack = value; } }
9393

94-
/* Get/Set the target this camera follows. */
9594
public abstract void SetFollowTarget(Transform trans);
9695
public abstract Transform GetFollowTarget();
9796

0 commit comments

Comments
 (0)