<commit_before>﻿using UnityEngine;
using System.Collections;

public class CarryableController : MonoBehaviour {

    private Animator anim;
    private bool carried = false;
    private Vector2 startPosition;
    private CameraFollow cameraFollow;

    void Awake()
    {
        anim = GetComponent<Animator>();
        startPosition = transform.position;
        GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");
        cameraFollow = camera.GetComponent<CameraFollow>();
    }

    public void SetCarriedStatus(bool status)
    {
        carried = status;
        anim.SetBool("Carried", status);
        // rigidbody2D.isKinematic = status;
        collider2D.isTrigger = status;
    }

    void FixedUpdate()
    {
        if(!InRange(transform.position.x, cameraFollow.minX, cameraFollow.maxX)
            || !InRange(transform.position.y, cameraFollow.minY - 5, cameraFollow.maxY + 5))
        {
            transform.position = startPosition;
            rigidbody2D.velocity = new Vector2(0.0f, 0.0f);
        }
    }

    bool InRange(float v, float min, float max)
    {
        return v >= min && v <= max;
    }

}<commit_msg>remove kinematic from carried boxes<commit_after>﻿using UnityEngine;
using System.Collections;

public class CarryableController : MonoBehaviour {

    private Animator anim;
    private bool carried = false;
    private Vector2 startPosition;
    private CameraFollow cameraFollow;

    void Awake()
    {
        anim = GetComponent<Animator>();
        startPosition = transform.position;
        GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");
        cameraFollow = camera.GetComponent<CameraFollow>();
    }

    public void SetCarriedStatus(bool status)
    {
        carried = status;
        anim.SetBool("Carried", status);
        collider2D.isTrigger = status;
    }

    void FixedUpdate()
    {
        if(!InRange(transform.position.x, cameraFollow.minX, cameraFollow.maxX)
            || !InRange(transform.position.y, cameraFollow.minY - 5, cameraFollow.maxY + 5))
        {
            transform.position = startPosition;
            rigidbody2D.velocity = new Vector2(0.0f, 0.0f);
        }
    }

    bool InRange(float v, float min, float max)
    {
        return v >= min && v <= max;
    }

}
{'fraction_non_alphanumeric': 0.09978213507625272, 'fraction_numerical': 0.009150326797385621, 'mean_word_length': 2.5763239875389408, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4722888', 'n_tokens_mistral': 667, 'n_tokens_neox': 647, 'n_words': 146}