Esempio n. 1
0
    private void OnDestroy()
    {
        NavArea2DManager navManager = FindObjectOfType <NavArea2DManager>();

        if (navManager != null)
        {
            navManager.navAreas.Remove(this);
        }
    }
Esempio n. 2
0
    private void Awake()
    {
        NavArea2DManager navManager = FindObjectOfType <NavArea2DManager>();

        if (navManager != null)
        {
            if (navManager.navAreas.Contains(this) == false)
            {
                navManager.navAreas.Add(this);
            }
        }
    }