mirror of
https://github.com/Steffo99/beat-td.git
synced 2024-11-29 02:14:19 +00:00
18 lines
650 B
C#
18 lines
650 B
C#
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);
|
|
}
|
|
}
|
|
}
|