1
Fork 0
mirror of https://github.com/Steffo99/beat-td.git synced 2024-11-26 01:04:18 +00:00
beat-td/Assets/Scripts/ExpandUntil.cs

19 lines
650 B
C#
Raw Normal View History

2018-04-22 21:05:11 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ExpandUntil : MonoBehaviour {
public float expansionSpeed = 1f;
public float maxExpansion = 5f;
void Update () {
if (transform.localScale.x <= 5f || transform.localScale.y <= 5f)
{
transform.localScale = new Vector3(Mathf.Clamp(transform.localScale.x + (expansionSpeed * Time.deltaTime), 0, 5),
Mathf.Clamp(transform.localScale.y + (expansionSpeed * Time.deltaTime), 0, 5),
transform.localScale.z);
}
}
}