24 lines
669 B
C#
24 lines
669 B
C#
using UnityEngine;
|
|
|
|
namespace Moonlit.FootstepPro
|
|
{
|
|
[AddComponentMenu("FootprintSystem/Standard Controller")]
|
|
public class StandardController : IFootstepController
|
|
{
|
|
public override void Callback(RaycastHit hitInfo, FootInfo foot)
|
|
{
|
|
SurfaceType surfaceType = GetSurfaceType(hitInfo);
|
|
if (surfaceType.AllowsFootprints)
|
|
{
|
|
GameObject prefab = GetPrefab(surfaceType, foot);
|
|
if (!(prefab == null))
|
|
{
|
|
Vector3 standardPosition = GetStandardPosition(hitInfo);
|
|
Quaternion standardRotation = GetStandardRotation(hitInfo, foot);
|
|
GameObject gameObject = Object.Instantiate(prefab, standardPosition, standardRotation);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|