using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace ETSI.ARF.WorldStorage.UI
{
    [ExecuteAlways]
    public class AttachToWorldAnchor : MonoBehaviour
    {
        public GameObject worldAnchor;
        public bool autoUpdate = true;

        private void Update()
        {
            if (autoUpdate && worldAnchor != null)
            {
                transform.position = worldAnchor.transform.position;
                transform.rotation = worldAnchor.transform.rotation;
            }
        }

        void OnDrawGizmos()
        {
#if UNITY_EDITOR
            // do something...
#endif
        }
    }
}
