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

namespace MPStudio
{
    public class BreatheScale : MonoBehaviour
    {
        //private SpriteRenderer sr;
        
        public float speed = 2f;


        public float ratio = 1f;

        private Vector3 initScale;
        private void Awake()
        {
          //  sr = GetComponent<SpriteRenderer>();
            initScale = transform.localScale;
        }

        // Start is called before the first frame update
        void Start()
        {

        }

        // Update is called once per frame
        void Update()
        {
            float f=Mathf.Abs( Mathf.Sin(Time.time*speed))*ratio;
            transform.localScale = initScale*(initScale.x + f);
        }
    }
}