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