Esempio n. 1
0
 void OnEnable()
 {
     if (handler != null)
     {
         GNavmeshClipper.AddEnableCallback(HandleOnEnableCallback, HandleOnDisableCallback);
         handler.graph.OnRecalculatedTiles += OnRecalculatedTiles;
     }
     forcedReloadRects.Clear();
 }
Esempio n. 2
0
        /** Use the specified handler, will create one at start if not called */
        public void UseSpecifiedHandler(TileHandler newHandler)
        {
            if (!enabled)
            {
                throw new System.InvalidOperationException("TileHandlerHelper is disabled");
            }

            if (handler != null)
            {
                GNavmeshClipper.RemoveEnableCallback(HandleOnEnableCallback, HandleOnDisableCallback);
                handler.graph.OnRecalculatedTiles -= OnRecalculatedTiles;
            }

            handler = newHandler;

            if (handler != null)
            {
                GNavmeshClipper.AddEnableCallback(HandleOnEnableCallback, HandleOnDisableCallback);
                handler.graph.OnRecalculatedTiles += OnRecalculatedTiles;
            }
        }