private void OnMouseDown() { if (!AnythingWarping) { StickyComponent.Unstick(0.1f); Warping = true; actions.PauseActions = true; ParentJellySprite.m_GravityScale = 0f; ParentJellySprite.InitMass(); // to update gravity //ParentJellySprite. StartCoroutine(GrowPortal(PortalWarpSpeed)); } }
public void JumpTowards(Vector2 direction) { if (PauseActions) { return; } if (Time.time - lastJumpTime < JumpDelay) { return; } if (!IsGrounded()) { return; } lastJumpTime = Time.time; jelly.LockRotation(false); sticky.Unstick(0.1f); jelly.AddForce(direction.normalized * JumpForce); }