using UnityEngine;

public class PopDisappear : MonoBehaviour {

    public float LifeTime;
    public float PopSize;
    private float startTime;
    private Vector3 startScale;

	void Start () {
        startTime = Time.time;
        startScale = transform.localScale;
	}
	
	void Update () {
        if (Time.time - startTime > LifeTime)
            GameObject.Destroy(gameObject);
        else
            transform.localScale = startScale * (1 + (PopSize * (Time.time - startTime) / LifeTime));
	}
}
