unity-atoms/Examples/Assets/InfiniteWaves/Common/SyncPositionWithVariable.cs

21 lines
446 B
C#
Raw Normal View History

2020-03-17 19:17:33 -04:00
using UnityEngine;
using UnityAtoms.BaseAtoms;
namespace UnityAtoms.Examples
{
2020-03-19 20:29:39 -04:00
/// <summary>
/// Script to sync the Vector3 Variable with this GameObject's current position.
/// </summary>
2020-03-17 19:17:33 -04:00
public class SyncPositionWithVariable : MonoBehaviour
{
[SerializeField]
private Vector3Reference _reference;
void LateUpdate()
{
_reference.Value = transform.position;
}
}
}