Esempio n. 1
0
 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));
     }
 }
Esempio n. 2
0
    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);
    }