mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-16 14:09:00 +07:00
PlayMaker and Tiled to Addons folder. CHANGELOG and README to Docs folder.
This commit is contained in:
50
Assets/IsoTools/Addons/Tiled/TiledMap.cs
Normal file
50
Assets/IsoTools/Addons/Tiled/TiledMap.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Internal;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace IsoTools.Tiled {
|
||||
[ExecuteInEditMode, DisallowMultipleComponent]
|
||||
[RequireComponent(typeof(IsoObject))]
|
||||
public class TiledMap : MonoBehaviour {
|
||||
|
||||
public TiledMapAsset Asset = null;
|
||||
public TiledMapProperties Properties = null;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// For editor
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[SerializeField] bool _isShowGrid = false;
|
||||
|
||||
public bool isShowGrid {
|
||||
get { return _isShowGrid; }
|
||||
set { _isShowGrid = value; }
|
||||
}
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Messages
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void OnDrawGizmos() {
|
||||
var iso_object = GetComponent<IsoObject>();
|
||||
if ( isShowGrid && iso_object && iso_object.isoWorld ) {
|
||||
IsoUtils.DrawGrid(
|
||||
iso_object.isoWorld,
|
||||
iso_object.position, iso_object.size,
|
||||
IsoUtils.ColorChangeA(Color.green, 0.5f));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user