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

public class CloudScript : MonoBehaviour {

    float life;

    // Use this for initialization
    void Start()
    {
        life = 2f;
    }

    // Update is called once per frame
    void Update()
    {
        life -= Time.deltaTime;
        Vector3 sc = this.transform.localScale;
        float fac = 100f/(100f - 10f * Time.deltaTime);
        sc *= fac * fac * fac * fac;
        this.transform.localScale = sc;

        Color col = this.GetComponent<SpriteRenderer>().color; 
        col.a = life/2f;
        this.GetComponent<SpriteRenderer>().color = col;

        if (life < 0f) Destroy(this.gameObject);

    }

}
