Files
HX_MapEditor/Assets/Scripts/Map/SceneArea.cs

52 lines
1.3 KiB
C#
Raw Normal View History

2025-06-22 15:21:25 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using static MapManager;
2025-06-22 18:23:47 +08:00
using static UnityEditor.PlayerSettings;
2025-06-22 15:21:25 +08:00
public class SceneArea : MonoBehaviour
{
public EditCellType editCellType;
public int Idx;
public void SetSceneAreaData(EditCellType editCellType,int idx)
{
this.editCellType = editCellType;
Idx = idx;
}
public void OnPointerClick()
{
Debug.Log($"ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
2025-06-22 18:23:47 +08:00
switch (editCellType)
{
case EditCellType.MonsterArea:
UIWindow.Instance.uiMonstersPanel.SelectMonsterPos(Idx);
break;
}
2025-06-22 15:21:25 +08:00
}
public void OnPointerDrag(Vector3 mousePosition)
{
Vector2Int pos = MapManager.Instance.map.selector.GetMouseByCell();
SetAreaPos(pos);
2025-06-22 18:23:47 +08:00
switch (editCellType)
{
case EditCellType.MonsterArea:
UIWindow.Instance.uiMonstersPanel.UpdateMonsterPos(Idx,pos);
break;
}
2025-06-22 15:21:25 +08:00
}
public void OnPointerUp()
{
Debug.Log($"<22>ɿ<EFBFBD><C9BF><EFBFBD><EFBFBD><EFBFBD>...");
}
public void SetAreaPos(Vector2Int pos)
{
Vector3 realpos = MapManager.Instance.map.selector.getPosByGrid(pos);
transform.position = realpos;
}
}