Skip to content

Commit f92d83f

Browse files
committed
Update for check drop ontop collider.
1 parent 1b0bda0 commit f92d83f

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public class JCS_Item
3434
[SerializeField]
3535
protected Collider mPickCollider = null;
3636

37-
3837
[Header("** Player Specific Settings (JCS_Item) **")]
3938

4039
[Tooltip("Is the auto pick collider must be player?")]
@@ -45,7 +44,6 @@ public class JCS_Item
4544
[SerializeField]
4645
protected KeyCode mPickKey = KeyCode.Z;
4746

48-
4947
[Header("** System Settings (JCS_Item) **")]
5048

5149
[Tooltip("Pick item by click/mouse?")]
@@ -61,7 +59,6 @@ public class JCS_Item
6159
[SerializeField]
6260
protected bool mAutoPickWhileCan = false;
6361

64-
6562
[Header("** Sound Settings (JCS_Item) **")]
6663

6764
[Tooltip(@"Play one shot while not playing any other sound. (Pick Sound)")]
@@ -82,7 +79,6 @@ public class JCS_Item
8279

8380
protected PickCallback mPickCallback = DefaultPickCallback;
8481

85-
8682
[Header("** Optional Variables (JCS_UnityObject) **")]
8783

8884
[Tooltip("Make item tween to the destination.")]
@@ -169,7 +165,6 @@ public void Pick(Collider other)
169165
JCS_OneJump joj = this.GetComponent<JCS_OneJump>();
170166
if (joj != null)
171167
{
172-
173168
// Only when item is on the ground!
174169
if (joj.GetVelocity().y != 0)
175170
return;

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ public class JCS_OneJump
2323

2424
private bool mEffect = false;
2525

26+
#if (UNITY_EDITOR)
27+
[Header("** Helper Variables (JCS_OneJump) **")]
28+
29+
[Tooltip("Name of the collider that blocks the jump.")]
30+
[SerializeField]
31+
private string mColliderName = null;
32+
#endif
33+
2634
[Header("** Runtime Variables (JCS_OneJump) **")]
2735

2836
[Tooltip("How many force to apply on jump?")]
@@ -178,12 +186,14 @@ private void TriggerDropping(Collider other)
178186
// stop this movement.
179187
if (JCS_GameSettings.instance.DEBUG_MODE)
180188
JCS_Debug.PrintName(other.transform);
189+
190+
mFixCollider = other;
181191
#endif
182192

183193
mVelocity.y = 0;
184194
mEffect = false;
185195

186-
mFixCollider = other;
196+
mColliderName = other.name;
187197

188198
// TODO(jenchieh): not all the object we get set are
189199
// box collider only.

0 commit comments

Comments
 (0)