You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/D2D_Scripts/Gameplay/RandomAppliers/RandomScaleApplier.cs

23 lines
500 B
C#

3 months ago
using D2D.Utilities;
using D2D.Utils;
using UnityEngine;
namespace D2D.Gameplay
{
public class RandomScaleApplier : MonoBehaviour
{
[SerializeField] private Vector2 _scaleRange;
[SerializeField] private bool _isRelative;
private void Start()
{
var from = Vector3.one;
if (_isRelative)
from = transform.localScale;
transform.localScale = from * _scaleRange.RandomFloat();
}
}
}