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/ThirteenPixels/Placr/Editor/Modifiers/PlacrModifierRandomRotation...

21 lines
542 B
C#

// Copyright © Sascha Graeff/13Pixels.
namespace ThirteenPixels.Placr
{
using UnityEngine;
public class PlacrModifierRandomRotationOffset : PlacrModifierBase
{
public override string title => "Random Rotational Offset";
[SerializeField, Range(0, 180)]
private float maxAngle = 10f;
public override void ApplyTo(GameObject gameObject)
{
var angle = Random.value * maxAngle;
gameObject.transform.rotation *= Quaternion.Euler(Vector3.up * angle);
}
}
}