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

public class scalingWiFi : MonoBehaviour {

    public float Timer;
    public int type = 0;
    float counter;
    public  float start = 0.0f;
    public float speed = 0.1f;
    float i = 0.0f;
    // Use this for initialization
    void Start () {
		
	}
	
	// Update is called once per frame
	void Update ()
    {
        counter += Time.deltaTime/10;

        if (counter >= Timer)
        {
            start = start + speed;
            counter = 0;
        }
        
        transform.localScale = new Vector3(start, start, 0);

        if (start >= 15.0f && type == 2)
        {
            Destroy(this.gameObject);
        }
        if (start >= 30.0f && type==3)
        {
            Destroy(this.gameObject);
        }
      //  GetComponent<SpriteRenderer>().sortingOrder--;
    }

    void OnTriggerEnter2D()
    {
        if (type == 1)
        {
            Destroy(this.gameObject);
        }
    }
}
