Editor 전처리기 처리
This commit is contained in:
parent
4b22ced124
commit
fdecd195f5
@ -1,77 +0,0 @@
|
|||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
|
||||||
{
|
|
||||||
public class AssetPostProcessor : AssetPostprocessor
|
|
||||||
{
|
|
||||||
private void OnPreprocessTexture()
|
|
||||||
{
|
|
||||||
var importer = assetImporter as TextureImporter;
|
|
||||||
|
|
||||||
var upperPath = importer.assetPath.ToUpper();
|
|
||||||
|
|
||||||
// if (upperPath.Contains("ASSETS/RAW/Units/"))
|
|
||||||
// {
|
|
||||||
// AssetPostprocessorModel.OnPreprocessTexture(importer);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (upperPath.Contains("ASSETS/_DATAS/RAW/SPRITES/"))
|
|
||||||
{
|
|
||||||
AssetPostprocessorSprite.OnPreprocessTexture(importer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void OnPostprocessAllAssets(string[] importedAssets, string[] deleteAssets, string[] movedAssets, string[] movedFromAssetPaths)
|
|
||||||
{
|
|
||||||
foreach (var path in deleteAssets)
|
|
||||||
{
|
|
||||||
PostRemove(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
var index = 0;
|
|
||||||
foreach (var path in movedFromAssetPaths)
|
|
||||||
{
|
|
||||||
PostRemove(path, movedAssets[index]);
|
|
||||||
++index;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var path in movedAssets)
|
|
||||||
{
|
|
||||||
PostAdd(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var path in importedAssets)
|
|
||||||
{
|
|
||||||
PostAdd(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
AssetPostprocessorSprite.BuildTarget();
|
|
||||||
AssetPostprocessorSprite.BuildTarget();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void PostRemove(string path, string movePath = "")
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
AssetPostprocessorSprite.OnRemove(path, movePath);
|
|
||||||
}
|
|
||||||
catch (System.Exception e)
|
|
||||||
{
|
|
||||||
Debug.LogError("Can't remove " + path + "\n" + e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void PostAdd(string path)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
AssetPostprocessorSprite.OnAdd(path);
|
|
||||||
}
|
|
||||||
catch (System.Exception e)
|
|
||||||
{
|
|
||||||
Debug.LogError("Can't import " + path + "\n" + e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 0027aa4e810904745aab9cda1a5e11be
|
|
@ -1,10 +1,11 @@
|
|||||||
|
#if UNITY_EDITOR
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Superlazy;
|
using Superlazy;
|
||||||
using UnityEditor;
|
|
||||||
using UnityEditor.U2D;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.U2D;
|
using UnityEngine.U2D;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEditor.U2D;
|
||||||
|
|
||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
@ -286,4 +287,5 @@ public static void BuildTarget()
|
|||||||
TargetPaths.Clear();
|
TargetPaths.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
@ -1,7 +1,10 @@
|
|||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
public class CellUI : MonoBehaviour
|
public class CellUI : MonoBehaviour
|
||||||
@ -39,10 +42,11 @@ private void OnDrawGizmos()
|
|||||||
{
|
{
|
||||||
// 기즈모 위치 예시
|
// 기즈모 위치 예시
|
||||||
Vector3 pos = transform.position;
|
Vector3 pos = transform.position;
|
||||||
|
#if UNITY_EDITOR
|
||||||
// 텍스트 표시
|
// 텍스트 표시
|
||||||
Handles.color = Color.black;
|
Handles.color = Color.black;
|
||||||
Handles.Label(pos, CellManager.WorldToCell(transform.position).ToString());
|
Handles.Label(pos, CellManager.WorldToCell(transform.position).ToString());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user