mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-15 01:12:05 +07:00
mesh tiled map
This commit is contained in:
@@ -52,7 +52,7 @@
|
|||||||
<Compile Include="Assets\IsoTools\Tiled\Internal\Editor\TiledMapLayerEditor.cs" />
|
<Compile Include="Assets\IsoTools\Tiled\Internal\Editor\TiledMapLayerEditor.cs" />
|
||||||
<Compile Include="Assets\IsoTools\Tiled\Internal\Editor\TiledMapPostprocessor.cs" />
|
<Compile Include="Assets\IsoTools\Tiled\Internal\Editor\TiledMapPostprocessor.cs" />
|
||||||
<Compile Include="Assets\IsoTools\Tiled\Internal\Editor\TiledMapPropertiesTests.cs" />
|
<Compile Include="Assets\IsoTools\Tiled\Internal\Editor\TiledMapPropertiesTests.cs" />
|
||||||
<Compile Include="Assets\IsoTools\Tiled\Internal\Editor\TiledMapTileEditor.cs" />
|
<Compile Include="Assets\IsoTools\Tiled\Internal\Editor\TiledMapTilesetEditor.cs" />
|
||||||
<Reference Include="UnityEditor.Advertisements">
|
<Reference Include="UnityEditor.Advertisements">
|
||||||
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Advertisements/Editor/UnityEditor.Advertisements.dll</HintPath>
|
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Advertisements/Editor/UnityEditor.Advertisements.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
<Compile Include="Assets\IsoTools\Tiled\TiledMapAsset.cs" />
|
<Compile Include="Assets\IsoTools\Tiled\TiledMapAsset.cs" />
|
||||||
<Compile Include="Assets\IsoTools\Tiled\TiledMapLayer.cs" />
|
<Compile Include="Assets\IsoTools\Tiled\TiledMapLayer.cs" />
|
||||||
<Compile Include="Assets\IsoTools\Tiled\TiledMapProperties.cs" />
|
<Compile Include="Assets\IsoTools\Tiled\TiledMapProperties.cs" />
|
||||||
<Compile Include="Assets\IsoTools\Tiled\TiledMapTile.cs" />
|
<Compile Include="Assets\IsoTools\Tiled\TiledMapTileset.cs" />
|
||||||
<Reference Include="UnityEngine.UI">
|
<Reference Include="UnityEngine.UI">
|
||||||
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
|
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 7b6bd76df16f04c1aadbdf1c8812c49a
|
guid: 7b6bd76df16f04c1aadbdf1c8812c49a
|
||||||
timeCreated: 1454257185
|
timeCreated: 1454766908
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 221bc03dca62748f284639c0b399875b
|
guid: 221bc03dca62748f284639c0b399875b
|
||||||
timeCreated: 1454758669
|
timeCreated: 1454796632
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
fileIDToRecycleName:
|
fileIDToRecycleName:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 108 KiB |
@@ -0,0 +1,562 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e7e6bc4bffa144ad4863e494f08333a4
|
||||||
|
timeCreated: 1454796632
|
||||||
|
licenseType: Free
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName:
|
||||||
|
21300000: isometric_grass_and_water2_25
|
||||||
|
21300002: isometric_grass_and_water2_26
|
||||||
|
21300004: isometric_grass_and_water2_27
|
||||||
|
21300006: isometric_grass_and_water2_28
|
||||||
|
21300008: isometric_grass_and_water2_29
|
||||||
|
21300010: isometric_grass_and_water2_30
|
||||||
|
21300012: isometric_grass_and_water2_31
|
||||||
|
21300014: isometric_grass_and_water2_32
|
||||||
|
21300016: isometric_grass_and_water2_33
|
||||||
|
21300018: isometric_grass_and_water2_34
|
||||||
|
21300020: isometric_grass_and_water2_35
|
||||||
|
21300022: isometric_grass_and_water2_36
|
||||||
|
21300024: isometric_grass_and_water2_37
|
||||||
|
21300026: isometric_grass_and_water2_38
|
||||||
|
21300028: isometric_grass_and_water2_39
|
||||||
|
21300030: isometric_grass_and_water2_40
|
||||||
|
21300032: isometric_grass_and_water2_41
|
||||||
|
21300034: isometric_grass_and_water2_42
|
||||||
|
21300036: isometric_grass_and_water2_43
|
||||||
|
21300038: isometric_grass_and_water2_44
|
||||||
|
21300040: isometric_grass_and_water2_45
|
||||||
|
21300042: isometric_grass_and_water2_46
|
||||||
|
21300044: isometric_grass_and_water2_47
|
||||||
|
21300046: isometric_grass_and_water2_48
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: 16
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 2
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
textureType: 8
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites:
|
||||||
|
- name: isometric_grass_and_water2_25
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 320
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -17, y: 30}
|
||||||
|
- {x: -32, y: 16}
|
||||||
|
- {x: -32, y: -4}
|
||||||
|
- {x: -5, y: -19}
|
||||||
|
- {x: 3, y: -19}
|
||||||
|
- {x: 32, y: -4}
|
||||||
|
- {x: 32, y: 21}
|
||||||
|
- {x: 12, y: 30}
|
||||||
|
- name: isometric_grass_and_water2_26
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 64
|
||||||
|
y: 320
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: 4, y: 30}
|
||||||
|
- {x: -12, y: 30}
|
||||||
|
- {x: -32, y: 17}
|
||||||
|
- {x: -32, y: -7}
|
||||||
|
- {x: -2, y: -19}
|
||||||
|
- {x: 4, y: -19}
|
||||||
|
- {x: 32, y: -3}
|
||||||
|
- {x: 32, y: 17}
|
||||||
|
- {x: 19, y: 25}
|
||||||
|
- name: isometric_grass_and_water2_27
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 128
|
||||||
|
y: 320
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: 10, y: 29}
|
||||||
|
- {x: -11, y: 29}
|
||||||
|
- {x: -32, y: 20}
|
||||||
|
- {x: -32, y: -4}
|
||||||
|
- {x: -4, y: -19}
|
||||||
|
- {x: 1, y: -19}
|
||||||
|
- {x: 32, y: -3}
|
||||||
|
- {x: 32, y: 15}
|
||||||
|
- {x: 30, y: 17}
|
||||||
|
- name: isometric_grass_and_water2_28
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 192
|
||||||
|
y: 320
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -7, y: 30}
|
||||||
|
- {x: -26, y: 20}
|
||||||
|
- {x: -32, y: 15}
|
||||||
|
- {x: -32, y: -3}
|
||||||
|
- {x: -4, y: -19}
|
||||||
|
- {x: 1, y: -19}
|
||||||
|
- {x: 32, y: -4}
|
||||||
|
- {x: 32, y: 16}
|
||||||
|
- {x: 12, y: 30}
|
||||||
|
- name: isometric_grass_and_water2_29
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 256
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -11, y: 29}
|
||||||
|
- {x: -32, y: 16}
|
||||||
|
- {x: -32, y: -8}
|
||||||
|
- {x: -9, y: -24}
|
||||||
|
- {x: 9, y: -24}
|
||||||
|
- {x: 25, y: -19}
|
||||||
|
- {x: 32, y: -7}
|
||||||
|
- {x: 32, y: 20}
|
||||||
|
- {x: 17, y: 29}
|
||||||
|
- name: isometric_grass_and_water2_30
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 64
|
||||||
|
y: 256
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -32, y: -10}
|
||||||
|
- {x: -10, y: -19}
|
||||||
|
- {x: 6, y: -19}
|
||||||
|
- {x: 32, y: -7}
|
||||||
|
- {x: 32, y: 31}
|
||||||
|
- {x: -32, y: 31}
|
||||||
|
- name: isometric_grass_and_water2_31
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 128
|
||||||
|
y: 256
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: 5, y: 30}
|
||||||
|
- {x: -28, y: 24}
|
||||||
|
- {x: -32, y: 14}
|
||||||
|
- {x: -32, y: -6}
|
||||||
|
- {x: -1, y: -19}
|
||||||
|
- {x: 4, y: -19}
|
||||||
|
- {x: 32, y: -3}
|
||||||
|
- {x: 32, y: 17}
|
||||||
|
- {x: 18, y: 30}
|
||||||
|
- name: isometric_grass_and_water2_32
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 192
|
||||||
|
y: 256
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -16, y: 27}
|
||||||
|
- {x: -32, y: 25}
|
||||||
|
- {x: -32, y: -11}
|
||||||
|
- {x: -6, y: -19}
|
||||||
|
- {x: 25, y: -19}
|
||||||
|
- {x: 32, y: -10}
|
||||||
|
- {x: 32, y: 1}
|
||||||
|
- {x: 20, y: 27}
|
||||||
|
- name: isometric_grass_and_water2_33
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 192
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -11, y: 29}
|
||||||
|
- {x: -12, y: 24}
|
||||||
|
- {x: -12, y: 23}
|
||||||
|
- {x: -14, y: 20}
|
||||||
|
- {x: -14, y: 15}
|
||||||
|
- {x: -14, y: 16}
|
||||||
|
- {x: -15, y: 23}
|
||||||
|
- {x: -28, y: 19}
|
||||||
|
- {x: -32, y: 1}
|
||||||
|
- {x: -32, y: -11}
|
||||||
|
- {x: -7, y: -24}
|
||||||
|
- {x: 2, y: -24}
|
||||||
|
- {x: 32, y: -11}
|
||||||
|
- {x: 32, y: 2}
|
||||||
|
- {x: 13, y: 29}
|
||||||
|
- name: isometric_grass_and_water2_34
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 64
|
||||||
|
y: 192
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: 3, y: 23}
|
||||||
|
- {x: -32, y: 5}
|
||||||
|
- {x: -32, y: -9}
|
||||||
|
- {x: -5, y: -24}
|
||||||
|
- {x: 10, y: -24}
|
||||||
|
- {x: 32, y: -7}
|
||||||
|
- {x: 32, y: 13}
|
||||||
|
- {x: 28, y: 23}
|
||||||
|
- name: isometric_grass_and_water2_35
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 128
|
||||||
|
y: 192
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -6, y: 19}
|
||||||
|
- {x: -14, y: 16}
|
||||||
|
- {x: -19, y: 14}
|
||||||
|
- {x: -32, y: -1}
|
||||||
|
- {x: -32, y: -12}
|
||||||
|
- {x: -13, y: -19}
|
||||||
|
- {x: 11, y: -19}
|
||||||
|
- {x: 14, y: -18}
|
||||||
|
- {x: 32, y: -10}
|
||||||
|
- {x: 32, y: 0}
|
||||||
|
- {x: 4, y: 19}
|
||||||
|
- name: isometric_grass_and_water2_36
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 192
|
||||||
|
y: 192
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -18, y: 27}
|
||||||
|
- {x: -32, y: 21}
|
||||||
|
- {x: -32, y: -8}
|
||||||
|
- {x: -11, y: -24}
|
||||||
|
- {x: 16, y: -24}
|
||||||
|
- {x: 32, y: -10}
|
||||||
|
- {x: 32, y: 4}
|
||||||
|
- {x: 5, y: 27}
|
||||||
|
- name: isometric_grass_and_water2_37
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 128
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -12, y: 28}
|
||||||
|
- {x: -14, y: 24}
|
||||||
|
- {x: -15, y: 19}
|
||||||
|
- {x: -32, y: -1}
|
||||||
|
- {x: -32, y: -9}
|
||||||
|
- {x: -5, y: -24}
|
||||||
|
- {x: 10, y: -24}
|
||||||
|
- {x: 32, y: -7}
|
||||||
|
- {x: 32, y: 13}
|
||||||
|
- {x: 19, y: 28}
|
||||||
|
- name: isometric_grass_and_water2_38
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 64
|
||||||
|
y: 128
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -21, y: 25}
|
||||||
|
- {x: -32, y: 4}
|
||||||
|
- {x: -32, y: -16}
|
||||||
|
- {x: -27, y: -19}
|
||||||
|
- {x: 2, y: -19}
|
||||||
|
- {x: 32, y: -9}
|
||||||
|
- {x: 32, y: 25}
|
||||||
|
- name: isometric_grass_and_water2_39
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 128
|
||||||
|
y: 128
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -32, y: -3}
|
||||||
|
- {x: -15, y: -19}
|
||||||
|
- {x: 28, y: -19}
|
||||||
|
- {x: 32, y: -17}
|
||||||
|
- {x: 32, y: 0}
|
||||||
|
- {x: 11, y: 28}
|
||||||
|
- {x: 6, y: 29}
|
||||||
|
- {x: -21, y: 29}
|
||||||
|
- {x: -32, y: 16}
|
||||||
|
- name: isometric_grass_and_water2_40
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 192
|
||||||
|
y: 128
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -9, y: 32}
|
||||||
|
- {x: -32, y: 15}
|
||||||
|
- {x: -32, y: -10}
|
||||||
|
- {x: -10, y: -24}
|
||||||
|
- {x: 14, y: -24}
|
||||||
|
- {x: 32, y: -9}
|
||||||
|
- {x: 32, y: 0}
|
||||||
|
- {x: 12, y: 32}
|
||||||
|
- name: isometric_grass_and_water2_41
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 64
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -9, y: 30}
|
||||||
|
- {x: -11, y: 26}
|
||||||
|
- {x: -15, y: 15}
|
||||||
|
- {x: -32, y: -2}
|
||||||
|
- {x: -32, y: -9}
|
||||||
|
- {x: -5, y: -24}
|
||||||
|
- {x: 10, y: -24}
|
||||||
|
- {x: 32, y: -8}
|
||||||
|
- {x: 32, y: 17}
|
||||||
|
- {x: 9, y: 30}
|
||||||
|
- name: isometric_grass_and_water2_42
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 64
|
||||||
|
y: 64
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -2, y: 23}
|
||||||
|
- {x: -32, y: -2}
|
||||||
|
- {x: -32, y: -10}
|
||||||
|
- {x: -10, y: -19}
|
||||||
|
- {x: 5, y: -19}
|
||||||
|
- {x: 32, y: -4}
|
||||||
|
- {x: 32, y: 17}
|
||||||
|
- {x: 19, y: 23}
|
||||||
|
- name: isometric_grass_and_water2_43
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 128
|
||||||
|
y: 64
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -21, y: 26}
|
||||||
|
- {x: -32, y: 14}
|
||||||
|
- {x: -32, y: -4}
|
||||||
|
- {x: -10, y: -19}
|
||||||
|
- {x: 13, y: -19}
|
||||||
|
- {x: 32, y: -12}
|
||||||
|
- {x: 32, y: 8}
|
||||||
|
- {x: 6, y: 26}
|
||||||
|
- name: isometric_grass_and_water2_44
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 192
|
||||||
|
y: 64
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -25, y: 32}
|
||||||
|
- {x: -32, y: 19}
|
||||||
|
- {x: -32, y: -14}
|
||||||
|
- {x: -3, y: -24}
|
||||||
|
- {x: 6, y: -24}
|
||||||
|
- {x: 32, y: -9}
|
||||||
|
- {x: 32, y: 0}
|
||||||
|
- {x: 7, y: 32}
|
||||||
|
- name: isometric_grass_and_water2_45
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -12, y: 29}
|
||||||
|
- {x: -14, y: 20}
|
||||||
|
- {x: -14, y: 15}
|
||||||
|
- {x: -14, y: 16}
|
||||||
|
- {x: -15, y: 23}
|
||||||
|
- {x: -27, y: 19}
|
||||||
|
- {x: -32, y: 2}
|
||||||
|
- {x: -32, y: -12}
|
||||||
|
- {x: -15, y: -19}
|
||||||
|
- {x: 14, y: -19}
|
||||||
|
- {x: 32, y: -13}
|
||||||
|
- {x: 32, y: 0}
|
||||||
|
- {x: 21, y: 23}
|
||||||
|
- {x: 14, y: 29}
|
||||||
|
- name: isometric_grass_and_water2_46
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 64
|
||||||
|
y: 0
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -16, y: 27}
|
||||||
|
- {x: -18, y: 26}
|
||||||
|
- {x: -32, y: 18}
|
||||||
|
- {x: -32, y: -6}
|
||||||
|
- {x: -8, y: -24}
|
||||||
|
- {x: 11, y: -24}
|
||||||
|
- {x: 27, y: -20}
|
||||||
|
- {x: 32, y: -5}
|
||||||
|
- {x: 32, y: 18}
|
||||||
|
- {x: 21, y: 27}
|
||||||
|
- name: isometric_grass_and_water2_47
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 128
|
||||||
|
y: 0
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -1, y: 14}
|
||||||
|
- {x: -32, y: -1}
|
||||||
|
- {x: -32, y: -11}
|
||||||
|
- {x: -2, y: -24}
|
||||||
|
- {x: 7, y: -24}
|
||||||
|
- {x: 32, y: -10}
|
||||||
|
- {x: 32, y: 0}
|
||||||
|
- {x: 4, y: 14}
|
||||||
|
- name: isometric_grass_and_water2_48
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 192
|
||||||
|
y: 0
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline:
|
||||||
|
- - {x: -1, y: 14}
|
||||||
|
- {x: -32, y: -1}
|
||||||
|
- {x: -32, y: -11}
|
||||||
|
- {x: -2, y: -24}
|
||||||
|
- {x: 7, y: -24}
|
||||||
|
- {x: 32, y: -10}
|
||||||
|
- {x: 32, y: 0}
|
||||||
|
- {x: 4, y: 14}
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -146,7 +146,7 @@ Camera:
|
|||||||
far clip plane: 1000
|
far clip plane: 1000
|
||||||
field of view: 60
|
field of view: 60
|
||||||
orthographic: 1
|
orthographic: 1
|
||||||
orthographic size: 6
|
orthographic size: 15
|
||||||
m_Depth: -1
|
m_Depth: -1
|
||||||
m_CullingMask:
|
m_CullingMask:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using IsoTools.Internal;
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IsoTools.Tiled.Internal {
|
namespace IsoTools.Tiled.Internal {
|
||||||
[CustomEditor(typeof(TiledMapAsset))]
|
[CustomEditor(typeof(TiledMapAsset))]
|
||||||
@@ -17,21 +18,34 @@ namespace IsoTools.Tiled.Internal {
|
|||||||
//
|
//
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
void CreateTiledMap(GameObject map_go) {
|
void CreateTiledMapOnScene() {
|
||||||
var iso_object = map_go.AddComponent<IsoObject>();
|
var map_go = new GameObject(_asset.Name);
|
||||||
iso_object.mode = IsoObject.Mode.Mode3d;
|
try {
|
||||||
iso_object.position = Vector3.zero;
|
CreateTiledMap(map_go);
|
||||||
iso_object.size = IsoUtils.Vec3FromXY(_asset.Data.Height, _asset.Data.Width);
|
} catch ( Exception e ) {
|
||||||
|
Debug.LogErrorFormat("Create tiled map error: {0}", e.Message);
|
||||||
|
DestroyImmediate(map_go, true);
|
||||||
|
}
|
||||||
|
Undo.RegisterCreatedObjectUndo(map_go, "Create Tiled Map");
|
||||||
|
}
|
||||||
|
|
||||||
var tiled_map = map_go.AddComponent<TiledMap>();
|
void CreateTiledMap(GameObject map_go) {
|
||||||
|
var map_data = _asset.Data;
|
||||||
|
|
||||||
|
var iso_object = map_go.AddComponent<IsoObject>();
|
||||||
|
iso_object.mode = IsoObject.Mode.Mode3d;
|
||||||
|
iso_object.position = Vector3.zero;
|
||||||
|
iso_object.size = IsoUtils.Vec3FromXY(map_data.Height, map_data.Width);
|
||||||
|
|
||||||
|
var tiled_map = map_go.AddComponent<TiledMap>();
|
||||||
tiled_map.Asset = _asset;
|
tiled_map.Asset = _asset;
|
||||||
tiled_map.Properties = new TiledMapProperties(_asset.Data.Properties);
|
tiled_map.Properties = new TiledMapProperties(map_data.Properties);
|
||||||
for ( int i = 0, e = _asset.Data.Layers.Count; i < e; ++i ) {
|
for ( int i = map_data.Layers.Count - 1; i >= 0; --i ) {
|
||||||
CreateTiledMapLayer(tiled_map, i);
|
CreateTiledLayer(tiled_map, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateTiledMapLayer(TiledMap map, int layer_index) {
|
void CreateTiledLayer(TiledMap map, int layer_index) {
|
||||||
var layer_data = _asset.Data.Layers[layer_index];
|
var layer_data = _asset.Data.Layers[layer_index];
|
||||||
|
|
||||||
var layer_go = new GameObject(layer_data.Name);
|
var layer_go = new GameObject(layer_data.Name);
|
||||||
@@ -41,114 +55,157 @@ namespace IsoTools.Tiled.Internal {
|
|||||||
-layer_data.OffsetY / _asset.PixelsPerUnit);
|
-layer_data.OffsetY / _asset.PixelsPerUnit);
|
||||||
layer_go.SetActive(layer_data.Visible);
|
layer_go.SetActive(layer_data.Visible);
|
||||||
|
|
||||||
var tiled_layer = layer_go.AddComponent<TiledMapLayer>();
|
var tiled_layer = layer_go.AddComponent<TiledMapLayer>();
|
||||||
tiled_layer.Asset = _asset;
|
tiled_layer.Asset = _asset;
|
||||||
tiled_layer.Properties = new TiledMapProperties(layer_data.Properties);
|
tiled_layer.Properties = new TiledMapProperties(layer_data.Properties);
|
||||||
|
for ( int i = 0, e = _asset.Data.Tilesets.Count; i < e; ++i ) {
|
||||||
|
CreateTiledTileset(tiled_layer, layer_index, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateTiledTileset(TiledMapLayer layer, int layer_index, int tileset_index) {
|
||||||
|
var tileset_data = _asset.Data.Tilesets[tileset_index];
|
||||||
|
|
||||||
|
var tileset_go = new GameObject(tileset_data.Name);
|
||||||
|
tileset_go.transform.SetParent(layer.transform, false);
|
||||||
|
|
||||||
|
var tiled_tileset = tileset_go.AddComponent<TiledMapTileset>();
|
||||||
|
tiled_tileset.Asset = _asset;
|
||||||
|
tiled_tileset.Properties = new TiledMapProperties(tileset_data.Properties);
|
||||||
|
CreateTiledTilesetMesh(tiled_tileset, tileset_index, layer_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateTiledTilesetMesh(TiledMapTileset tileset, int tileset_index, int layer_index) {
|
||||||
|
var mesh_filter = tileset.gameObject.AddComponent<MeshFilter>();
|
||||||
|
mesh_filter.mesh = GetTilesetMesh(tileset_index, layer_index);
|
||||||
|
var mesh_renderer = tileset.gameObject.AddComponent<MeshRenderer>();
|
||||||
|
mesh_renderer.sharedMaterial = GetTilesetMaterial(tileset_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
Mesh GetTilesetMesh(int tileset_index, int layer_index) {
|
||||||
|
var vertices = new List<Vector3>();
|
||||||
|
var triangles = new List<int>();
|
||||||
|
var uvs = new List<Vector2>();
|
||||||
for ( var tile_y = 0; tile_y < _asset.Data.Height; ++tile_y ) {
|
for ( var tile_y = 0; tile_y < _asset.Data.Height; ++tile_y ) {
|
||||||
for ( var tile_x = 0; tile_x < _asset.Data.Width; ++tile_x ) {
|
for ( var tile_x = 0; tile_x < _asset.Data.Width; ++tile_x ) {
|
||||||
CreateTileMapTile(tiled_layer, layer_index, tile_x, tile_y);
|
var tile_gid = _asset.Data
|
||||||
|
.Layers[layer_index]
|
||||||
|
.Tiles[tile_y * _asset.Data.Width + tile_x];
|
||||||
|
if ( tile_gid > 0 && CheckTileGidByTileset(tile_gid, tileset_index) ) {
|
||||||
|
var tile_iso_pos = new Vector3(
|
||||||
|
-tile_y + _asset.Data.Height - 1,
|
||||||
|
-tile_x + _asset.Data.Width - 1);
|
||||||
|
|
||||||
|
var iso_world = GetIsoWorld();
|
||||||
|
var tile_screen_pos = iso_world.IsoToScreen(tile_iso_pos);
|
||||||
|
var tile_sprite = GetTileSprite(tile_gid, tileset_index);
|
||||||
|
var tile_width = tile_sprite.rect.width / _asset.PixelsPerUnit;
|
||||||
|
var tile_height = tile_sprite.rect.height / _asset.PixelsPerUnit;
|
||||||
|
var tileset_data = _asset.Data.Tilesets[tileset_index];
|
||||||
|
var tileset_offset_x = tileset_data.TileOffsetX / _asset.PixelsPerUnit;
|
||||||
|
var tileset_offset_y = tileset_data.TileOffsetY / _asset.PixelsPerUnit;
|
||||||
|
|
||||||
|
var vertex_pos =
|
||||||
|
IsoUtils.Vec3FromVec2(tile_screen_pos) -
|
||||||
|
IsoUtils.Vec3FromXY(tile_width, tile_height) * 0.5f +
|
||||||
|
IsoUtils.Vec3FromXY(tileset_offset_x, tileset_offset_y);
|
||||||
|
|
||||||
|
vertices.Add(vertex_pos);
|
||||||
|
vertices.Add(vertex_pos + IsoUtils.Vec3FromX (tile_width));
|
||||||
|
vertices.Add(vertex_pos + IsoUtils.Vec3FromXY(tile_width, tile_height));
|
||||||
|
vertices.Add(vertex_pos + IsoUtils.Vec3FromY (tile_height));
|
||||||
|
|
||||||
|
triangles.Add(vertices.Count - 4 + 2);
|
||||||
|
triangles.Add(vertices.Count - 4 + 1);
|
||||||
|
triangles.Add(vertices.Count - 4 + 0);
|
||||||
|
triangles.Add(vertices.Count - 4 + 0);
|
||||||
|
triangles.Add(vertices.Count - 4 + 3);
|
||||||
|
triangles.Add(vertices.Count - 4 + 2);
|
||||||
|
|
||||||
|
var tex_size = new Vector2(tile_sprite.texture.width, tile_sprite.texture.height);
|
||||||
|
uvs.Add(new Vector2(tile_sprite.rect.xMin / tex_size.x, tile_sprite.rect.yMin / tex_size.y));
|
||||||
|
uvs.Add(new Vector2(tile_sprite.rect.xMax / tex_size.x, tile_sprite.rect.yMin / tex_size.y));
|
||||||
|
uvs.Add(new Vector2(tile_sprite.rect.xMax / tex_size.x, tile_sprite.rect.yMax / tex_size.y));
|
||||||
|
uvs.Add(new Vector2(tile_sprite.rect.xMin / tex_size.x, tile_sprite.rect.yMax / tex_size.y));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var mesh = new Mesh();
|
||||||
|
mesh.vertices = vertices.ToArray();
|
||||||
|
mesh.triangles = triangles.ToArray();
|
||||||
|
mesh.uv = uvs.ToArray();
|
||||||
|
mesh.RecalculateNormals();
|
||||||
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateTileMapTile(TiledMapLayer layer, int layer_index, int tile_x, int tile_y) {
|
IsoWorld GetIsoWorld() {
|
||||||
var layer_data = _asset.Data.Layers[layer_index];
|
var iso_world = GameObject.FindObjectOfType<IsoWorld>();
|
||||||
|
if ( !iso_world ) {
|
||||||
var tile_gid = layer_data.Tiles[tile_y * _asset.Data.Width + tile_x];
|
throw new UnityException("not found IsoWorld");
|
||||||
if ( tile_gid > 0 ) {
|
|
||||||
var asset_path = AssetDatabase.GetAssetPath(_asset);
|
|
||||||
if ( string.IsNullOrEmpty(asset_path) ) {
|
|
||||||
throw new UnityException(string.Format(
|
|
||||||
"not found tiled map asset ({0}) path",
|
|
||||||
_asset.name));
|
|
||||||
}
|
|
||||||
|
|
||||||
var iso_world = GameObject.FindObjectOfType<IsoWorld>();
|
|
||||||
if ( !iso_world ) {
|
|
||||||
throw new UnityException("not found IsoWorld");
|
|
||||||
}
|
|
||||||
|
|
||||||
var tileset = FindTilesetByTileGid(tile_gid);
|
|
||||||
if ( tileset == null ) {
|
|
||||||
throw new UnityException(string.Format(
|
|
||||||
"tileset for tile ({0}) on layer ({1}) not found",
|
|
||||||
tile_gid, layer_data.Name));
|
|
||||||
}
|
|
||||||
|
|
||||||
var tile_tileset_sprite_name = string.Format(
|
|
||||||
"{0}_{1}",
|
|
||||||
Path.GetFileNameWithoutExtension(tileset.ImageSource),
|
|
||||||
tile_gid);
|
|
||||||
var tileset_assets = AssetDatabase.LoadAllAssetsAtPath(
|
|
||||||
Path.Combine(Path.GetDirectoryName(asset_path), tileset.ImageSource));
|
|
||||||
var tile_sprite = tileset_assets
|
|
||||||
.Where(p => p is Sprite && p.name == tile_tileset_sprite_name)
|
|
||||||
.Select(p => p as Sprite)
|
|
||||||
.FirstOrDefault();
|
|
||||||
if ( !tile_sprite ) {
|
|
||||||
throw new UnityException(string.Format(
|
|
||||||
"sprite ({0}) for tile ({1}) on layer ({2}) not found",
|
|
||||||
tile_tileset_sprite_name, tile_gid, layer_data.Name));
|
|
||||||
}
|
|
||||||
|
|
||||||
var iso_x = -tile_y + _asset.Data.Height - 1;
|
|
||||||
var iso_y = -tile_x + _asset.Data.Width - 1;
|
|
||||||
|
|
||||||
var tile_go = new GameObject(string.Format(
|
|
||||||
"Tile_{0}_{1}", iso_x, iso_y));
|
|
||||||
tile_go.transform.SetParent(layer.transform, false);
|
|
||||||
|
|
||||||
tile_go.transform.localPosition =
|
|
||||||
iso_world.IsoToScreen(IsoUtils.Vec3FromXY(iso_x, iso_y));
|
|
||||||
|
|
||||||
tile_go.transform.localPosition += new Vector3(
|
|
||||||
tileset.TileOffsetX / _asset.PixelsPerUnit,
|
|
||||||
tileset.TileOffsetY / _asset.PixelsPerUnit,
|
|
||||||
(iso_x + iso_y + layer_index) * iso_world.stepDepth);
|
|
||||||
|
|
||||||
var tiled_tile = tile_go.AddComponent<TiledMapTile>();
|
|
||||||
tiled_tile.Asset = _asset;
|
|
||||||
tiled_tile.Properties = new TiledMapProperties(tileset.Properties);
|
|
||||||
|
|
||||||
var tile_spr = tile_go.AddComponent<SpriteRenderer>();
|
|
||||||
tile_spr.sprite = tile_sprite;
|
|
||||||
}
|
}
|
||||||
|
return iso_world;
|
||||||
}
|
}
|
||||||
|
|
||||||
TiledMapTilesetData FindTilesetByTileGid(int tile_gid) {
|
string GetTiledMapAssetPath() {
|
||||||
return _asset.Data.Tilesets.Find(p => {
|
var asset_path = AssetDatabase.GetAssetPath(_asset);
|
||||||
return tile_gid >= p.FirstGid && tile_gid < p.FirstGid + p.TileCount;
|
if ( string.IsNullOrEmpty(asset_path) ) {
|
||||||
});
|
throw new UnityException(string.Format(
|
||||||
}
|
"not found tiled map asset ({0}) path",
|
||||||
|
_asset.name));
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// Functions
|
|
||||||
//
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void CreateTiledMapPrefab() {
|
|
||||||
var tiled_map = CreateTiledMapOnScene();
|
|
||||||
if ( tiled_map ) {
|
|
||||||
var asset_path = AssetDatabase.GetAssetPath(_asset);
|
|
||||||
var prefab_path = Path.Combine(Path.GetDirectoryName(asset_path), _asset.Name + ".prefab");
|
|
||||||
PrefabUtility.CreatePrefab(prefab_path, tiled_map);
|
|
||||||
DestroyImmediate(tiled_map, true);
|
|
||||||
/// \TODO undo support
|
|
||||||
}
|
}
|
||||||
|
return asset_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject CreateTiledMapOnScene() {
|
bool CheckTileGidByTileset(int tile_gid, int tileset_index) {
|
||||||
var map_go = new GameObject(_asset.Name);
|
var tileset_data = _asset.Data.Tilesets[tileset_index];
|
||||||
try {
|
return
|
||||||
CreateTiledMap(map_go);
|
tile_gid >= tileset_data.FirstGid &&
|
||||||
} catch ( Exception e ) {
|
tile_gid < tileset_data.FirstGid + tileset_data.TileCount;
|
||||||
Debug.LogErrorFormat("Create tiled map error: {0}", e.Message);
|
}
|
||||||
DestroyImmediate(map_go, true);
|
|
||||||
map_go = null;
|
Sprite GetTileSprite(int tile_gid, int tileset_index) {
|
||||||
|
var tileset_data = _asset.Data.Tilesets[tileset_index];
|
||||||
|
var tile_sprite_name = string.Format(
|
||||||
|
"{0}_{1}",
|
||||||
|
Path.GetFileNameWithoutExtension(tileset_data.ImageSource),
|
||||||
|
tile_gid);
|
||||||
|
var tileset_assets = AssetDatabase.LoadAllAssetsAtPath(Path.Combine(
|
||||||
|
Path.GetDirectoryName(GetTiledMapAssetPath()),
|
||||||
|
tileset_data.ImageSource));
|
||||||
|
var tile_sprite = tileset_assets
|
||||||
|
.Where(p => p is Sprite && p.name == tile_sprite_name)
|
||||||
|
.Select(p => p as Sprite)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if ( !tile_sprite ) {
|
||||||
|
throw new UnityException(string.Format(
|
||||||
|
"sprite ({0}) for tile ({1}) not found",
|
||||||
|
tile_sprite_name, tile_gid));
|
||||||
}
|
}
|
||||||
Undo.RegisterCreatedObjectUndo(map_go, "Create TiledMap");
|
return tile_sprite;
|
||||||
return map_go;
|
}
|
||||||
|
|
||||||
|
Material GetTilesetMaterial(int tileset_index) {
|
||||||
|
var shader = Shader.Find("Sprites/Default");
|
||||||
|
if ( !shader ) {
|
||||||
|
throw new UnityException("'Sprites/Default' shader not found");
|
||||||
|
}
|
||||||
|
var material = new Material(shader);
|
||||||
|
material.SetTexture("_MainTex", GetTilesetTexture(tileset_index));
|
||||||
|
return material;
|
||||||
|
}
|
||||||
|
|
||||||
|
Texture2D GetTilesetTexture(int tileset_index) {
|
||||||
|
var tileset_data = _asset.Data.Tilesets[tileset_index];
|
||||||
|
var texture_path = Path.Combine(
|
||||||
|
Path.GetDirectoryName(GetTiledMapAssetPath()),
|
||||||
|
tileset_data.ImageSource);
|
||||||
|
var texture = AssetDatabase.LoadAssetAtPath<Texture2D>(texture_path);
|
||||||
|
if ( !texture ) {
|
||||||
|
throw new UnityException(string.Format(
|
||||||
|
"texture ({0}) for tileset ({1}) not found",
|
||||||
|
texture_path, tileset_data.Name));
|
||||||
|
}
|
||||||
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
@@ -163,14 +220,9 @@ namespace IsoTools.Tiled.Internal {
|
|||||||
|
|
||||||
public override void OnInspectorGUI() {
|
public override void OnInspectorGUI() {
|
||||||
DrawDefaultInspector();
|
DrawDefaultInspector();
|
||||||
EditorGUILayout.BeginHorizontal();
|
if ( GUILayout.Button("Create tiled map on scene") ) {
|
||||||
if ( GUILayout.Button("Create map prefab") ) {
|
|
||||||
CreateTiledMapPrefab();
|
|
||||||
}
|
|
||||||
if ( GUILayout.Button("Create map on scene") ) {
|
|
||||||
CreateTiledMapOnScene();
|
CreateTiledMapOnScene();
|
||||||
}
|
}
|
||||||
EditorGUILayout.EndHorizontal();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ using IsoTools.Tiled;
|
|||||||
using IsoTools.Internal;
|
using IsoTools.Internal;
|
||||||
|
|
||||||
namespace IsoTools.Tiled.Internal {
|
namespace IsoTools.Tiled.Internal {
|
||||||
[CustomEditor(typeof(TiledMapTile)), CanEditMultipleObjects]
|
[CustomEditor(typeof(TiledMapTileset)), CanEditMultipleObjects]
|
||||||
class TiledMapTileEditor : Editor {
|
class TiledMapTileEditor : Editor {
|
||||||
TiledMapTile _tile = null;
|
TiledMapTileset _tileset = null;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
@@ -21,13 +21,13 @@ namespace IsoTools.Tiled.Internal {
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
void OnEnable() {
|
void OnEnable() {
|
||||||
_tile = target as TiledMapTile;
|
_tileset = target as TiledMapTileset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnInspectorGUI() {
|
public override void OnInspectorGUI() {
|
||||||
DrawDefaultInspector();
|
DrawDefaultInspector();
|
||||||
if ( _tile && _tile.Properties != null ) {
|
if ( _tileset && _tileset.Properties != null ) {
|
||||||
_tile.Properties.OnInspectorGUI("Tileset properties");
|
_tileset.Properties.OnInspectorGUI("Tileset properties");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ using UnityEditor;
|
|||||||
|
|
||||||
namespace IsoTools.Tiled {
|
namespace IsoTools.Tiled {
|
||||||
[ExecuteInEditMode, DisallowMultipleComponent]
|
[ExecuteInEditMode, DisallowMultipleComponent]
|
||||||
public class TiledMapTile : MonoBehaviour {
|
public class TiledMapTileset : MonoBehaviour {
|
||||||
|
|
||||||
public TiledMapAsset Asset = null;
|
public TiledMapAsset Asset = null;
|
||||||
public TiledMapProperties Properties = null;
|
public TiledMapProperties Properties = null;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 6aede06b08d82497586194285ed30f71
|
guid: 771457a2414954117b1fbe3a1178f023
|
||||||
timeCreated: 1454274398
|
timeCreated: 1454774218
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -2,10 +2,9 @@
|
|||||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
|
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
|
||||||
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Tiled/Internal/Editor/TiledMapAssetEditor.cs">
|
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Tiled/Internal/Editor/TiledMapAssetEditor.cs">
|
||||||
<Files>
|
<Files>
|
||||||
<File FileName="Assets/IsoTools/Tiled/Internal/Editor/TiledMapAssetEditor.cs" Line="119" Column="40" />
|
<File FileName="Assets/IsoTools/Tiled/Internal/Editor/TiledMapAssetEditor.cs" Line="51" Column="28" />
|
||||||
<File FileName="Assets/IsoTools/Tiled/Internal/Editor/TiledMapPostprocessor.cs" Line="138" Column="7" />
|
<File FileName="Assets/IsoTools/Tiled/TiledMapTileset.cs" Line="17" Column="1" />
|
||||||
<File FileName="Assets/IsoTools/Scripts/Internal/Editor/IsoObjectEditor.cs" Line="1" Column="1" />
|
<File FileName="Assets/IsoTools/Tiled/TiledMapAsset.cs" Line="49" Column="10" NotebookId="1" />
|
||||||
<File FileName="Assets/IsoTools/Tiled/TiledMapAsset.cs" Line="1" Column="1" NotebookId="1" />
|
|
||||||
</Files>
|
</Files>
|
||||||
</MonoDevelop.Ide.Workbench>
|
</MonoDevelop.Ide.Workbench>
|
||||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
|
|||||||
Reference in New Issue
Block a user