Example #1
0
 public Pathfinder(PolyNav2D map, Transform transform, bool repath)
 {
     _map           = map;
     this.transform = transform;
     if (repath)
     {
         Pathfinding.RepathAll += () =>
         {
             if (!map.CheckLOS(position, nextPoint))
             {
                 Repath();
             }
         };
     }
 }
Example #2
0
 static int CheckLOS(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         PolyNav2D           obj  = (PolyNav2D)ToLua.CheckObject <PolyNav2D>(L, 1);
         UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 2);
         UnityEngine.Vector2 arg1 = ToLua.ToVector2(L, 3);
         bool o = obj.CheckLOS(arg0, arg1);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }