Пример #1
0
    private void SetSpawningZones()
    {
        Vector3 bottomLeft = tilemap.GetCellCenterWorld(new Vector3Int(tileMapXMin, tileMapYMin, 0));
        Vector3 topRight   = tilemap.GetCellCenterWorld(new Vector3Int(tileMapXMax, tileMapYMax, 0));

        WorldXMin = bottomLeft.x;
        WorldYMin = bottomLeft.y;
        WorldXMax = topRight.x;
        WorldYMax = topRight.y;
    }
Пример #2
0
    public Vector3 randomEmpty()
    {
        Vector3Int x;

        for (x = new Vector3Int(Random.Range(-16, 16), Random.Range(-16, 16), 0); WallMap.HasTile(x); x = new Vector3Int(Random.Range(-16, 16), Random.Range(-16, 16), 0))
        {
            ;
        }
        return(Zone.GetCellCenterWorld(x));
    }
Пример #3
0
    static int GetCellCenterWorld(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 2);
            UnityEngine.Tilemaps.Tilemap obj  = (UnityEngine.Tilemaps.Tilemap)ToLua.CheckObject(L, 1, typeof(UnityEngine.Tilemaps.Tilemap));
            UnityEngine.Vector3Int       arg0 = StackTraits <UnityEngine.Vector3Int> .Check(L, 2);

            UnityEngine.Vector3 o = obj.GetCellCenterWorld(arg0);
            ToLua.Push(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }