38 lines
836 B
C#
38 lines
836 B
C#
using UnityEngine;
|
|
|
|
namespace ShrinkTutorial
|
|
{
|
|
public class ShrinkTutorialAnchor : MonoBehaviour
|
|
{
|
|
[SerializeField] private string anchorId = string.Empty;
|
|
|
|
public string AnchorId => anchorId;
|
|
|
|
public void SetAnchorId(string value)
|
|
{
|
|
anchorId = value ?? string.Empty;
|
|
|
|
if (isActiveAndEnabled)
|
|
ShrinkTutorialAnchorRegistry.Register(this);
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
ShrinkTutorialAnchorRegistry.Register(this);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
ShrinkTutorialAnchorRegistry.Unregister(this);
|
|
}
|
|
|
|
private void OnValidate()
|
|
{
|
|
if (!Application.isPlaying)
|
|
return;
|
|
|
|
ShrinkTutorialAnchorRegistry.Register(this);
|
|
}
|
|
}
|
|
}
|