27 lines
657 B
C#
27 lines
657 B
C#
using Sandbox;
|
|
|
|
public sealed class NormalGravityTrigger : Component, Component.ITriggerListener
|
|
{
|
|
// public void OnTriggerEnter(Collider other)
|
|
// {
|
|
// var otherEntity = other.GameObject;
|
|
//
|
|
// if (otherEntity.Components.TryGet<Dedugan>(out var controller))
|
|
// {
|
|
// Log.Info($"{otherEntity.Name} вошел в зону нормальной гравитации");
|
|
//
|
|
// controller.OverrideGravity = Vector3.Down;
|
|
// }
|
|
// }
|
|
|
|
public void OnTriggerExit(Collider other)
|
|
{
|
|
var otherEntity = other.GameObject;
|
|
|
|
if (otherEntity.Components.TryGet<Dedugan>(out var controller))
|
|
{
|
|
controller.OverrideGravity = Vector3.Zero;
|
|
}
|
|
}
|
|
}
|