using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MosQuito : MonoBehaviour
{
    public bool canmovebug = false;
    public bool canmovebie = false;

    public Vector3 orgScale;
    public Vector3 orgPos;

    public bool ded = false;
    public GameObject win;
    // Use this for initialization
    void Start ()
    {
        orgScale = transform.localScale;
        orgPos = transform.position;

    }
	
	// Update is called once per frame
	void Update ()
    {
       //if (transform.localScale.x <= 2f)
       //{
       //    //transform.position = orgPos;
       //    transform.parent.gameObject.transform.position = orgPos;
       //    transform.localScale = orgScale;
       //}
//  if(transform.localScale.x > 2)
//      shrink.shrinking = true;
//
    }

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if(collision.gameObject.CompareTag("Bug"))
        {
            Debug.Log("Crashed with bug");
            canmovebug = true;
            //gameObject.SetActive(false);
            gameObject.transform.parent.gameObject.SetActive(false);
            collision.GetComponent<Shrinking>().enabled = true;
            collision.GetComponentInParent<Drag>().enabled = true;
        }
        if (collision.gameObject.CompareTag("Bie"))
        {
            win.SetActive(true);
            Time.timeScale = 0;
        }
    }
}
