add readme and license

This commit is contained in:
BlackMATov
2023-01-05 04:35:10 +07:00
parent 062520f601
commit dd52dfd57c
19 changed files with 454 additions and 58 deletions

BIN
.github/images/custom-isometric.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 KiB

BIN
.github/images/mix-2d-and-3d.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

BIN
.github/images/play-maker.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

BIN
.github/images/sample-1.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

BIN
.github/images/sample-2.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

BIN
.github/images/sample-3.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

BIN
.github/images/sample-4.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
.github/images/title-icon.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

194
Assets/IsoTools/Docs/API.md Normal file
View File

@@ -0,0 +1,194 @@
## IsoWorld
![](./Images/api-image-1.png)
```csharp
float tileSize { get; set; } // (0.00; ----) "A" (Image 1)
float tileRatio { get; set; } // (0.25; 1.00) "A" * tileRatio = "B"
float tileAngle { get; set; } // (0.00; 90.0) "D"
float tileHeight { get; set; } // (0.00; ----) "C"
```
```csharp
float startDepth { get; set; } // start value for depth sorting
float stepDepth { get; set; } // step depth sorting for every object
```
```csharp
static int AllWorldCount { get; } // Number of IsoWorld
static IsoWorld GetWorld(int index); // Get active IsoWorld by index
```
```csharp
// Convert 3D isometric coordinates to 2D screen coordinates
// iso - isometric coordinates
// [return] - converted screen coordinates
Vector2 IsoToScreen(Vector3 iso);
// Convert 2D screen coordinates to 3D isometric coordinates
// pos - screen coordinates
// iso_z - specific isometric Z
// [return] - converted isometric coordinates
Vector3 ScreenToIso(Vector2 pos, float iso_z = 0.0f);
```
```csharp
// Convert touch position to isometric coordinates for main camera
// finger_id - finger id
// iso_z - specific isometric Z
Vector3 TouchIsoPosition(int finger_id, float iso_z = 0.0f);
// Convert touch position to isometric coordinates for specific camera
// finger_id - finger id
// camera - specific camera
// iso_z - specific isometric Z
Vector3 TouchIsoPosition(int finger_id, Camera camera, float iso_z = 0.0f);
```
```csharp
// Convert touch position to isometric coordinates of tile for main camera
// finger_id - finger id
// iso_z - specific isometric Z
Vector3 TouchIsoTilePosition(int finger_id, float iso_z = 0.0f);
// Convert touch position to isometric coordinates of tile for specific camera
// finger_id - finger id
// camera - specific camera
// iso_z - specific isometric Z
Vector3 TouchIsoTilePosition(int finger_id, Camera camera, float iso_z = 0.0f);
```
```csharp
// Convert mouse position to isometric coordinates for main camera
// iso_z - specific isometric Z
Vector3 MouseIsoPosition(float iso_z = 0.0f)
// Convert mouse position to isometric coordinates for specific camera
// camera - specific camera
// iso_z - specific isometric Z
Vector3 MouseIsoPosition(Camera camera, float iso_z = 0.0f)
```
```csharp
// Convert mouse position to isometric coordinates of tile for main camera
// iso_z - specific isometric Z
Vector3 MouseIsoTilePosition(float iso_z = 0.0f);
// Convert mouse position to isometric coordinates of tile for specific camera
// camera - specific camera
// iso_z - specific isometric Z
Vector3 MouseIsoTilePosition(Camera camera, float iso_z = 0.0f);
```
## IsoObject
![](./Images/api-image-2.png)
```csharp
public enum Mode {
Mode2d, // sorting mode for sprites
Mode3d // sorting mode for 3d models
}
// Sorting mode
Mode mode { get; set; }
```
```csharp
// If enable, you should call "UpdateCachedRenderers"
// when you change children hierarchy for this "IsoObject"
bool cacheRenderers { get; set; }
```
```csharp
bool isAlignment { get; set; } // aligment by tiles in editor
bool isShowBounds { get; set; } // show object bounds in editor
```
```csharp
Vector3 size { get; set; } // Isometric size of object
float sizeX { get; set; } // Isometric size of object by X
float sizeY { get; set; } // Isometric size of object by Y
float sizeZ { get; set; } // Isometric size of object by Z
Vector2 sizeXY { get; set; } // Isometric size of object by XY plane
Vector2 sizeYZ { get; set; } // Isometric size of object by YZ plane
Vector2 sizeXZ { get; set; } // Isometric size of object by XZ plane
```
```csharp
Vector3 position { get; set; } // Isometric position of object
float positionX { get; set; } // Isometric position of object by X
float positionY { get; set; } // Isometric position of object by Y
float positionZ { get; set; } // Isometric position of object by Z
Vector2 positionXY { get; set; } // Isometric position of object by XY plane
Vector2 positionYZ { get; set; } // Isometric position of object by YZ plane
Vector2 positionXZ { get; set; } // Isometric position of object by XZ plane
```
```csharp
Vector3 tilePosition { get; set; } // Isometric position of object tile
float tilePositionX { get; set; } // Isometric position of object tile by X
float tilePositionY { get; set; } // Isometric position of object tile by Y
float tilePositionZ { get; set; } // Isometric position of object tile by Z
Vector2 tilePositionXY { get; set; } // Isometric position of object tile by XY plane
Vector2 tilePositionYZ { get; set; } // Isometric position of object tile by YZ plane
Vector2 tilePositionXZ { get; set; } // Isometric position of object tile by XZ plane
```
```csharp
// Return Ray from virtual isometric camera to isometric point
Ray RayFromIsoCameraToIsoPoint(Vector3 iso_pnt);
```
## IsoPhysics
```csharp
bool Raycast(...)
int RaycastNonAlloc(...)
...
```
Copy of Unity raycast functions ([Physics.Raycast](http://docs.unity3d.com/ScriptReference/Physics.Raycast.html), [Physics.RaycastNonAlloc](http://docs.unity3d.com/ScriptReference/Physics.RaycastNonAlloc.html), [Physics.BoxCast](https://docs.unity3d.com/ScriptReference/Physics.BoxCast.html) etc.) for isometric world.
## Physics events
```csharp
void OnIsoTriggerEnter (IsoCollider iso_collider);
void OnIsoTriggerExit (IsoCollider iso_collider);
void OnIsoCollisionEnter (IsoCollision iso_collision);
void OnIsoCollisionExit (IsoCollision iso_collision);
```
Copy of Unity physics events ([OnTriggerEnter](http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerEnter.html), [OnTriggerExit](http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerExit.html), [OnCollisionEnter](http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnCollisionEnter.html), [OnCollisionExit](http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnCollisionExit.html)) for isometric world.
> Note! For listen trigger events you should add add IsoTriggerListener for your IsoObject and IsoCollisionListener for listen collision events.
## IsoRigidbody
Copy of [Rigidbody](http://docs.unity3d.com/ScriptReference/Rigidbody.html) for isometric world.
## IsoCollider
Copy of [Collider](http://docs.unity3d.com/ScriptReference/Collider.html) for isometric world.
## IsoBoxCollider
Copy of [BoxCollider](http://docs.unity3d.com/ScriptReference/BoxCollider.html) for isometric world.
## IsoSphereCollider
Copy of [SphereCollider](http://docs.unity3d.com/ScriptReference/SphereCollider.html) for isometric world.
## IsoCapsuleCollider
Copy of [CapsuleCollider](http://docs.unity3d.com/ScriptReference/CapsuleCollider.html) for isometric world.
## IsoCollision
Copy of [Collision](http://docs.unity3d.com/ScriptReference/Collision.html) for isometric world.
## IsoContactPoint
Copy of [ContactPoint](http://docs.unity3d.com/ScriptReference/ContactPoint.html) for isometric world.
## IsoRaycastHit
Copy of [RaycastHit](http://docs.unity3d.com/ScriptReference/RaycastHit.html) for isometric world.

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8c523fcdd4fcc4d099ff1d4fc2482e31
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,35 +1,35 @@
###### Version 3.1.0
### Version 3.1.0
* fix some saving issues in Unity 2018-2019
* drop legacy Unity versions (before 2017 LTS)
###### Version 3.0.6
### Version 3.0.6
* Minor promo fixes
###### Version 3.0.5
### Version 3.0.5
* Fix for Unity 2019
###### Version 3.0.4
### Version 3.0.4
* Fix sorting problem after Undo in Editor
###### Version 3.0.3
### Version 3.0.3
* Speed up debug gizmos render
* Fix Unity 5.6 - 2017.3 warnings
* Disable iso object snapping by children
###### Version 3.0.2
### Version 3.0.2
* Physics settings in IsoWorld inspector
###### Version 3.0.1
### Version 3.0.1
* Fix serialization generic classes problem
###### Version 3.0.0
### Version 3.0.0
* Fix Unity 5.5 warning
* IsoPhysics to Addons/Physics
@@ -39,20 +39,20 @@
* Multiple isometric worlds in one scene
* Temporarily removed TiledMap support
###### Version 2.4.2
### Version 2.4.2
* Bug fixing
###### Version 2.4.1
### Version 2.4.1
* Bug fixing
###### Version 2.4
### Version 2.4
* Snapping support for editor
* Physic raycast from iso camera support (IsoWorld.RayFromIsoCameraToIsoPoint)
###### Version 2.3.2
### Version 2.3.2
* Bug fixing
- 'DontDestroyOnLoad' now working with physic objects
@@ -64,37 +64,37 @@
- 'Cache renderers' flag for IsoObject
- 'IsoWorld.Instance' for get IsoWorld singleton instance
###### Version 2.3.1
### Version 2.3.1
* Bug fixing
###### Version 2.3
### Version 2.3
* Initial Tiled Map Editor support
###### Version 2.2
### Version 2.2
* PlayMaker support
###### Version 2.1
### Version 2.1
* Add mix 2D and 3D support
* Custom isometric tile angle, ratio and height
* Add some mouse and touch functions
* Bug fixing
###### Version 2.0
### Version 2.0
* Physics support! (Colliders, Rigidbodies, Trigger and Collision events)
* Many helpful upgrades for editor
* New samples
* Bug fixing
###### Version 1.4
### Version 1.4
* Added the new sorting algorithm to improve performance noticeably.
###### Version 1.3
### Version 1.3
* New 'UpDown' isometric type (like jrpg).
* Optional sorting flag.
@@ -102,10 +102,10 @@
* Added Unity 5 support.
* Fix some bugs.
###### Version 1.1
### Version 1.1
* Fix some bugs.
###### Version 1.0
### Version 1.0
* Initial version.

View File

@@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: 46a2a91dd01fa4f928f22a025254e5f5
timeCreated: 1487354125
licenseType: Free
guid: 612f663b0c90146f89fe2a01215dd66f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -0,0 +1,76 @@
fileFormatVersion: 2
guid: 7b575cdd852cc476f85f9adb2657f8fe
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@@ -0,0 +1,76 @@
fileFormatVersion: 2
guid: 271680d36104946e4b9cde71338e43d8
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,34 +0,0 @@
##### Isometric 2.5D Toolset
Make 2.5D isometric game in Unity easy!
* [Usage video (Sprites)](http://www.youtube.com/watch?v=IwJ_ofKG9_Y)
* [Usage video (Physics)](http://www.youtube.com/watch?v=wmXhyDHXYcM)
* [Site](https://blackmatov.github.io/unity-assets/isometric-toolset)
* [Forum](https://forum.unity.com/threads/isometric-2-5d-toolset.291418)
* [Web demo](https://blackmatov.github.io/unity-assets/isometric-toolset/demo)
###### Features
* Automatic sorting 2D isometric tiles and objects;
* Sorting objects with single-tile size as well as multiple-tiles size;
* Auxiliary functions for converting isometric coordinates into screen coordinates and conversely;
* Placing and snapping of objects in the Unity editor;
* Helpful mouse and touch functions;
* Custom isometric tile angle, ratio and height;
* Support multiple isometric worlds in a scene with different settings;
* Mix 2D and 3D support;
* Physics support! (Colliders, Rigidbodies, Trigger and Collision events);
* Full PlayMaker support.
###### Limitations
* Intersection of isometric objects is not allowed;
* Parent-child related isometric objects is not allowed.
Supports Unity 2017 and newer, both Personal and Pro. Full C# source code included.
Leave your rating for this Asset. It is very important for me and the development of the project :) Thank you!
Samples use (CC0 1.0) sprites from [kenney.nl](http://www.kenney.nl/assets)
Samples use (CC BY 4.0) sprites from [dragosha.com](http://dragosha.com/free)
Samples use free models from [Honeti's models](https://assetstore.unity.com/packages/3d/characters/humanoids/fantasy/3-free-characters-18098)

21
LICENSE.md Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (C) 2015-2022, by Matvey Cherevko (blackmatov@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

56
README.md Normal file
View File

@@ -0,0 +1,56 @@
![](.github/images/title-icon.jpg)
# Isometric 2.5D Toolset
> Make 2.5D isometric game in Unity easy!
[Asset Store](https://assetstore.unity.com/packages/tools/sprite-management/isometric-2-5d-toolset-27851) |
[Forum](https://forum.unity.com/threads/isometric-2-5d-toolset.291418/) |
[Usage Video (Sprites)](http://www.youtube.com/watch?v=IwJ_ofKG9_Y) |
[Usage Video (Physics)](http://www.youtube.com/watch?v=wmXhyDHXYcM) |
[API Reference](Assets/IsoTools/Docs/API.md) |
[Changelog](Assets/IsoTools/Docs/CHANGELOG.md)
## Features
- Automatic sorting 2D isometric tiles and objects
- Sorting objects with single-tile size as well as multiple-tiles size
- Auxiliary functions for converting isometric coordinates into screen coordinates and conversely
- Placing and snapping of objects in the Unity editor
- Physics support! (Colliders, Rigidbodies, Trigger and Collision events, Raycasts)
- Helpful mouse and touch functions
- Custom isometric tile angle, ratio and height
- Mix 2D and 3D support
- Full [PlayPaker](https://assetstore.unity.com/packages/tools/visual-scripting/playmaker-368) support
Supports Unity 2017.4 (LTS) and newer, both Personal and Pro. Full C# source code included.
Leave your rating for this Asset. It is very important for me and the development of the project :) Thank you!
## Limitations
- Intersection of isometric objects is not allowed
- Parent-child related isometric objects is not allowed
## Screenshots
### PlayMaker Support
![](.github/images/play-maker.gif)
### Custom isometric tile angle, ratio and height
![](.github/images/custom-isometric.gif)
### Mix 2D and 3D support
![](.github/images/mix-2d-and-3d.gif)
### Preview samples
![](.github/images/sample-1.gif)
![](.github/images/sample-2.gif)
![](.github/images/sample-3.gif)
![](.github/images/sample-4.gif)
## [License (MIT)](./LICENSE.md)
* Samples use (CC0 1.0) sprites from [kenney.nl](http://www.kenney.nl/assets)
* Samples use (CC BY 4.0) sprites from [dragosha.com](http://dragosha.com/free)
* Samples use free models from [Honeti's models](https://assetstore.unity.com/packages/3d/characters/humanoids/fantasy/3-free-characters-18098)