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

public class WaveExpansion : MonoBehaviour {

	SpriteRenderer spr;
    public bool atract;

	void Start(){
		spr= GetComponent<SpriteRenderer> ();
	}

	void Update () {
        if (!atract)
        {
            transform.localScale += Time.deltaTime * Vector3.one * 0.8f;
            spr.color -= Color.black * 0.03f;
            if (transform.localScale.x > 1f)
            {
                transform.localScale = 0.15f * Vector3.one;
                spr.color = new Color(241, 255, 0);
            }
        }else
        {
            transform.localScale -= Time.deltaTime * Vector3.one * 0.8f;
            spr.color += Color.black * 0.01f;
            if (transform.localScale.x < 0f)
            {
                transform.localScale = 1f * Vector3.one;
                spr.color = new Color(241, 255, 0,0);
            }
        }

	}
}
