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.
23 lines
500 B
C#
23 lines
500 B
C#
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();
|
|
}
|
|
}
|
|
}
|