@@ -52,10 +52,6 @@ public class PlayerMotor2D : MonoBehaviour
52
52
[ Range ( 0f , 1f ) ]
53
53
public float heavyInputThreshold = 0.5f ;
54
54
55
- // Set this to use a specific collider for checks instead of grabbing the collider from gameObject.collider2D.
56
- [ HideInInspector ]
57
- public Collider2D colliderToUse ;
58
-
59
55
// Delegates, attach to these to get event calls.
60
56
public Notification onDash ;
61
57
public Notification onDashEnd ;
@@ -75,7 +71,8 @@ public enum MotorState
75
71
Sliding ,
76
72
OnCorner ,
77
73
Clinging ,
78
- Dashing
74
+ Dashing ,
75
+ Frozen
79
76
}
80
77
81
78
private Surface stuckTo = Surface . None ;
@@ -189,9 +186,9 @@ public void ForceJump(float extraSpeed = 0)
189
186
}
190
187
191
188
/**
192
- * Allows a double jump to occur. This only has effect if double jumps are allowed.
189
+ * Resets a double jump to occur. This only has effect if double jumps are allowed.
193
190
* */
194
- public void AllowDoubleJump ( )
191
+ public void ResetDoubleJump ( )
195
192
{
196
193
jumping . doubleJumped = false ;
197
194
}
@@ -222,18 +219,6 @@ public void EndDash()
222
219
dashing . forceEnd = true ;
223
220
}
224
221
225
- public void SetFacingOffAxis ( float axis )
226
- {
227
- if ( axis < - inputThreshold )
228
- {
229
- facingLeft = true ;
230
- }
231
- else if ( axis > inputThreshold )
232
- {
233
- facingLeft = false ;
234
- }
235
- }
236
-
237
222
void FixedUpdate ( )
238
223
{
239
224
// Frozen?
@@ -799,7 +784,7 @@ private float CalculateJumpSpeed()
799
784
/**
800
785
* Set the movement direction. Ideally this should be a normalized vector but could be larger for faster speeds. READONLY
801
786
**/
802
- public Vector2 movementDir { set ; private get ; }
787
+ public Vector2 movementDir { get ; set ; }
803
788
804
789
/**
805
790
* Call this to get state information about the motor. This will be information such as if the object is in the air or on the ground. This can be used
@@ -810,7 +795,7 @@ private float CalculateJumpSpeed()
810
795
/**
811
796
* Since the motor needs to know the facing of the object, this information is made available to anyone else who might need it.
812
797
**/
813
- public bool facingLeft { get ; private set ; }
798
+ public bool facingLeft { get ; set ; }
814
799
815
800
/**
816
801
* Set this true to have the motor fall faster. Set to false to fall at normal speeds.
@@ -859,6 +844,7 @@ public bool frozen
859
844
860
845
rigidbody2D . velocity = Vector2 . zero ;
861
846
rigidbody2D . gravityScale = 0 ;
847
+ motorState = MotorState . Frozen ;
862
848
}
863
849
else
864
850
{
@@ -891,6 +877,11 @@ public bool frozen
891
877
* */
892
878
public bool changeDrag { get ; set ; }
893
879
880
+ /**
881
+ * Set this to use a specific collider for checks instead of grabbing the collider from gameObject.collider2D.
882
+ * */
883
+ public Collider2D colliderToUse { get ; set ; }
884
+
894
885
//
895
886
// Debug
896
887
//
0 commit comments