예제 #1
0
    /// <summary>Does simple error checking</summary>
    internal void VerifyIntegrity()
    {
        if (active != this)
        {
            throw new System.Exception("Singleton pattern broken. Make sure you only have one AstarPath object in the scene");
        }

        if (data == null)
        {
            throw new System.NullReferenceException("data is null... A* not set up correctly?");
        }

        if (data.graphs == null)
        {
            data.graphs = new NavGraph[0];
            data.UpdateShortcuts();
        }
    }