NLDClient-yudde/ProjectNLD/Assets/ThirdParty/TerrainGridSystem/Scripts/Snippets/TGSDetectMovement.cs

27 lines
545 B
C#
Raw Normal View History

2023-08-22 19:08:45 +08:00
using UnityEngine;
namespace TGS {
[AddComponentMenu ("Kronnect/Terrain Grid System/TGS Detect Movement")]
public class TGSDetectMovement : TGSSnippetBase {
Vector3 oldPosition;
protected override void Configure() {
instructions = "Awakes other snippets when this gameobject moves.";
hideOptions = true;
oldPosition = transform.position;
}
void LateUpdate() {
execute = ExecutionEvent.Immediate;
if (transform.position != oldPosition) {
oldPosition = transform.position;
PingSnippets ();
}
}
}
}