添加
This commit is contained in:
38
Assets/Scripts/Map/SceneArea.cs
Normal file
38
Assets/Scripts/Map/SceneArea.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using static MapManager;
|
||||
|
||||
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>...");
|
||||
|
||||
}
|
||||
public void OnPointerDrag(Vector3 mousePosition)
|
||||
{
|
||||
Vector2Int pos = MapManager.Instance.map.selector.GetMouseByCell();
|
||||
SetAreaPos(pos);
|
||||
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user