BITFALL/Assets/Plugins/Character Controller Pro/Demo/Scripts/VerticalDirectionModifier3D.cs

27 lines
588 B
C#

using UnityEngine;
using Lightbug.CharacterControllerPro.Core;
namespace Lightbug.CharacterControllerPro.Demo
{
public class VerticalDirectionModifier3D : VerticalDirectionModifier
{
void OnTriggerEnter(Collider other)
{
if (!isReady)
return;
CharacterActor characterActor = GetCharacter(other.transform);
if (characterActor != null)
{
HandleUpDirection(characterActor);
characterActor.Teleport(reference.referenceTransform);
}
}
}
}