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

namespace MPStudio
{
    public class BreatheAlpha : MonoBehaviour
    {

        public float speed = 2f;
        
        private SpriteRenderer sr;

        private void Awake()
        {
            sr = GetComponent<SpriteRenderer>();

          // print(sr.color.a);
        }

        private void Start()
        {
            
        }

        private void Update()
        {
           float f=Mathf.Abs( Mathf.Cos(Time.time*speed));
           
           sr.color = new Color(sr.color.r, sr.color.g, sr.color.b, f);
        }
    }
}