12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using UnityEngine;
- namespace UnityARInterface
- {
- public class ARAnchor : ARBase
- {
- [HideInInspector]
- public string anchorID;
- private ARInterface m_ARInterface;
- private bool started;
- private void Awake()
- {
- m_ARInterface = ARInterface.GetInterface();
- if (m_ARInterface == null)
- Destroy(this);
- }
- void Start()
- {
- UpdateAnchor();
- started = true;
- }
- private void OnEnable()
- {
- if (started)
- UpdateAnchor();
- }
- private void OnDisable()
- {
- m_ARInterface.DestroyAnchor(this);
- }
- private void OnDestroy()
- {
- m_ARInterface.DestroyAnchor(this);
- }
- public void UpdateAnchor()
- {
- m_ARInterface.DestroyAnchor(this);
- m_ARInterface.ApplyAnchor(this);
- }
- }
- }
|