2023-12-15 18:32:21 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
2024-11-20 19:55:55 +08:00
|
|
|
|
using cfg.FightCfg;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
using Gameplay;
|
|
|
|
|
|
using MapEditor;
|
2024-08-08 18:57:34 +08:00
|
|
|
|
using PhxhSDK;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
using PhxhSDK.Phxh;
|
|
|
|
|
|
using Sirenix.OdinInspector.Editor;
|
|
|
|
|
|
using TGS;
|
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
|
using UnityEditor.SceneManagement;
|
|
|
|
|
|
using UnityEngine;
|
2024-08-08 18:57:34 +08:00
|
|
|
|
using UnityEngine.Rendering.Universal;
|
|
|
|
|
|
using Constants = Framework.Constants;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
using Object = UnityEngine.Object;
|
|
|
|
|
|
|
|
|
|
|
|
[CustomEditor(typeof(MapManager))]
|
|
|
|
|
|
public class MapManagerInspector : OdinEditor
|
|
|
|
|
|
{
|
2023-12-21 15:05:08 +08:00
|
|
|
|
private enum ECameraCheckCorner
|
|
|
|
|
|
{
|
|
|
|
|
|
None,
|
|
|
|
|
|
LeftDown,
|
|
|
|
|
|
RightDown,
|
|
|
|
|
|
LeftUp,
|
|
|
|
|
|
RightUp,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private readonly string[] checkCornerType = new[]
|
|
|
|
|
|
{
|
|
|
|
|
|
"无",
|
|
|
|
|
|
"左下角",
|
|
|
|
|
|
"右下角",
|
|
|
|
|
|
"左上角",
|
|
|
|
|
|
"右上角",
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2023-12-15 18:32:21 +08:00
|
|
|
|
private readonly string[] environmentType = new[]
|
|
|
|
|
|
{
|
|
|
|
|
|
"平原",
|
|
|
|
|
|
"山地",
|
|
|
|
|
|
"草原",
|
|
|
|
|
|
"林地",
|
|
|
|
|
|
"雪地",
|
|
|
|
|
|
"泥地",
|
|
|
|
|
|
"戈壁",
|
|
|
|
|
|
"沙漠",
|
|
|
|
|
|
"高原",
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
private MapManager Target => target as MapManager;
|
|
|
|
|
|
|
|
|
|
|
|
private TerrainGridSystem TGS => Target.TGS;
|
|
|
|
|
|
|
|
|
|
|
|
private MapData MapData => Target.MapData;
|
2024-01-12 14:17:17 +08:00
|
|
|
|
|
|
|
|
|
|
private Map Map => Target.Map;
|
2024-08-08 18:57:34 +08:00
|
|
|
|
|
2023-12-15 18:32:21 +08:00
|
|
|
|
private bool _isEditingGrid;
|
2023-12-21 15:05:08 +08:00
|
|
|
|
private bool _isEditingCameraOriginPos;
|
|
|
|
|
|
private bool _isCheckingCamera;
|
2024-08-12 13:01:56 +08:00
|
|
|
|
private bool _isEditingCameraInfo;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
|
2023-12-21 15:05:08 +08:00
|
|
|
|
private ECameraCheckCorner _checkType;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
|
2024-07-02 18:13:12 +08:00
|
|
|
|
private const string MapConfigPrefix = "MapData_";
|
2024-08-08 18:57:34 +08:00
|
|
|
|
private const string UICanvasCheck = "Assets/Editor/MapEditor/LevelUICheck.prefab";
|
|
|
|
|
|
private GameObject _uiLevelCheck;
|
2024-07-02 18:13:12 +08:00
|
|
|
|
|
2023-12-21 15:05:08 +08:00
|
|
|
|
//scene gui
|
2023-12-15 18:32:21 +08:00
|
|
|
|
private bool _isHitGround;
|
|
|
|
|
|
private Vector3 _mouseHitPosition;
|
|
|
|
|
|
private Event _currEvent;
|
|
|
|
|
|
private GameObject _ground;
|
|
|
|
|
|
private RaycastHit[] _hits = new RaycastHit[1];
|
|
|
|
|
|
|
|
|
|
|
|
protected override void OnEnable()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnEnable();
|
|
|
|
|
|
var allTgs = Object.FindObjectsOfType<TerrainGridSystem>();
|
|
|
|
|
|
foreach (var tgs in allTgs)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (tgs != TGS)
|
|
|
|
|
|
{
|
2023-12-18 20:31:58 +08:00
|
|
|
|
foreach (Transform child in tgs.transform)
|
|
|
|
|
|
{
|
|
|
|
|
|
child.gameObject.SetActive(false);
|
|
|
|
|
|
}
|
2023-12-15 18:32:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-18 19:42:46 +08:00
|
|
|
|
|
|
|
|
|
|
DeActiveScene();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void DeActiveScene()
|
|
|
|
|
|
{
|
|
|
|
|
|
var sceneManagers = FindObjectsOfType<NLDSceneManager>();
|
|
|
|
|
|
foreach (var sceneManager in sceneManagers)
|
|
|
|
|
|
{
|
2023-12-20 12:47:57 +08:00
|
|
|
|
SceneVisibilityManager.instance.DisablePicking(sceneManager.Art.gameObject, true);
|
2023-12-18 19:42:46 +08:00
|
|
|
|
}
|
2023-12-15 18:32:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void OnDisable()
|
|
|
|
|
|
{
|
2024-08-08 18:57:34 +08:00
|
|
|
|
if (_uiLevelCheck)
|
|
|
|
|
|
DestroyImmediate(_uiLevelCheck);
|
2024-08-12 13:01:56 +08:00
|
|
|
|
if (GameObject.Find("LevelUICheck(Clone)"))
|
2024-08-08 18:57:34 +08:00
|
|
|
|
DestroyImmediate(GameObject.Find("LevelUICheck(Clone)"));
|
2023-12-15 18:32:21 +08:00
|
|
|
|
base.OnDisable();
|
|
|
|
|
|
Target.SaveMapData();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnInspectorGUI()
|
|
|
|
|
|
{
|
2023-12-21 15:05:08 +08:00
|
|
|
|
if (Application.isPlaying)
|
2023-12-20 12:47:57 +08:00
|
|
|
|
return;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
base.OnInspectorGUI();
|
|
|
|
|
|
DrawCreateMapData();
|
|
|
|
|
|
DrawMapData();
|
2023-12-20 12:47:57 +08:00
|
|
|
|
EditorSceneManager.MarkSceneDirty(Target.gameObject.scene);
|
2023-12-15 18:32:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void DrawCreateMapData()
|
|
|
|
|
|
{
|
2023-12-21 19:08:04 +08:00
|
|
|
|
if (GUILayout.Button("创建地图配置"))
|
2023-12-15 18:32:21 +08:00
|
|
|
|
{
|
2023-12-21 19:08:04 +08:00
|
|
|
|
var mapDataDir = Path.GetDirectoryName(Constants.MAP_CONFIG_FORMAT_PATH);
|
2024-08-08 18:57:34 +08:00
|
|
|
|
var dataPath =
|
|
|
|
|
|
EditorUtil.GetAssetUniquePath($"{mapDataDir}/{MapConfigPrefix + Target.gameObject.scene.name}.json",
|
|
|
|
|
|
out var textName);
|
2023-12-21 19:08:04 +08:00
|
|
|
|
using (var fileStream = File.Create(dataPath))
|
2023-12-15 18:32:21 +08:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-21 19:08:04 +08:00
|
|
|
|
AssetDatabase.Refresh();
|
|
|
|
|
|
var textAsset = AssetDatabase.LoadAssetAtPath<TextAsset>(dataPath);
|
|
|
|
|
|
EditorGUIUtility.PingObject(textAsset);
|
2023-12-26 17:05:08 +08:00
|
|
|
|
Target.MapDataJson = textAsset;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void DrawMapData()
|
|
|
|
|
|
{
|
|
|
|
|
|
Target.MapDataJson =
|
|
|
|
|
|
EditorGUILayout.ObjectField("地图配置", Target.MapDataJson, typeof(TextAsset), false) as TextAsset;
|
|
|
|
|
|
if (Target.MapDataJson != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
EditorGUI.BeginChangeCheck();
|
2023-12-18 19:42:46 +08:00
|
|
|
|
var column = EditorGUILayout.DelayedIntField("网格宽度", TGS.columnCount);
|
|
|
|
|
|
var raw = EditorGUILayout.DelayedIntField("网格高度", TGS.rowCount);
|
2023-12-15 18:32:21 +08:00
|
|
|
|
if (EditorGUI.EndChangeCheck())
|
|
|
|
|
|
{
|
2023-12-18 19:42:46 +08:00
|
|
|
|
var width = column;
|
|
|
|
|
|
var height = raw;
|
|
|
|
|
|
MapData.Width = width;
|
|
|
|
|
|
MapData.Height = height;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
TGS.columnCount = width;
|
|
|
|
|
|
TGS.rowCount = height;
|
2023-12-18 19:42:46 +08:00
|
|
|
|
Target.SaveMapData();
|
|
|
|
|
|
Target.Refresh();
|
2023-12-20 12:47:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EditorGUI.BeginChangeCheck();
|
|
|
|
|
|
var gridOffset = EditorGUILayout.Vector2Field("网格偏移",
|
|
|
|
|
|
new Vector2(TGS.transform.position.x, TGS.transform.position.z));
|
|
|
|
|
|
if (EditorGUI.EndChangeCheck())
|
|
|
|
|
|
{
|
|
|
|
|
|
var transform = TGS.transform;
|
|
|
|
|
|
transform.position = new Vector3(gridOffset.x, 0, gridOffset.y);
|
|
|
|
|
|
MapData.position = transform.position;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MapData.environmentType =
|
2024-11-20 19:55:55 +08:00
|
|
|
|
(ELevelTerrainType)EditorGUILayout.Popup("环境类型", (int)MapData.environmentType, environmentType);
|
2023-12-18 19:42:46 +08:00
|
|
|
|
|
2023-12-21 15:30:37 +08:00
|
|
|
|
DrawCheckCamera();
|
|
|
|
|
|
DrawCameraOriginPosition();
|
2023-12-21 15:05:08 +08:00
|
|
|
|
|
2023-12-21 15:30:37 +08:00
|
|
|
|
if (GUILayout.Button("打开网格编辑器"))
|
2023-12-21 15:05:08 +08:00
|
|
|
|
{
|
2023-12-21 15:30:37 +08:00
|
|
|
|
MapGridWindow.OpenWindow(Target);
|
2023-12-21 15:05:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-12 13:01:56 +08:00
|
|
|
|
DrawCameraInfo();
|
2023-12-21 15:30:37 +08:00
|
|
|
|
if (GUILayout.Button("保存"))
|
2023-12-21 15:05:08 +08:00
|
|
|
|
{
|
2023-12-21 15:30:37 +08:00
|
|
|
|
Target.SaveMapData();
|
2023-12-21 15:05:08 +08:00
|
|
|
|
}
|
2023-12-21 15:30:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-21 15:05:08 +08:00
|
|
|
|
|
2024-08-12 13:01:56 +08:00
|
|
|
|
private void DrawCameraInfo()
|
|
|
|
|
|
{
|
|
|
|
|
|
_isEditingCameraInfo = EditorGUILayout.Toggle("编辑相机间距", _isEditingCameraInfo);
|
|
|
|
|
|
if (_isEditingCameraInfo)
|
|
|
|
|
|
{
|
|
|
|
|
|
MapData.cameraMarginInfo.leftMarginInFight =
|
|
|
|
|
|
EditorGUILayout.FloatField("战斗中相机左间距", MapData.cameraMarginInfo.leftMarginInFight);
|
|
|
|
|
|
MapData.cameraMarginInfo.rightMarginInFight =
|
|
|
|
|
|
EditorGUILayout.FloatField("战斗中相机右间距", MapData.cameraMarginInfo.rightMarginInFight);
|
|
|
|
|
|
MapData.cameraMarginInfo.topMarginInFight =
|
|
|
|
|
|
EditorGUILayout.FloatField("战斗中相机上间距", MapData.cameraMarginInfo.topMarginInFight);
|
|
|
|
|
|
MapData.cameraMarginInfo.bottomMarginInFight =
|
|
|
|
|
|
EditorGUILayout.FloatField("战斗中相机下间距", MapData.cameraMarginInfo.bottomMarginInFight);
|
|
|
|
|
|
|
|
|
|
|
|
MapData.cameraMarginInfo.leftMarginInPre =
|
|
|
|
|
|
EditorGUILayout.FloatField("准备前相机左间距", MapData.cameraMarginInfo.leftMarginInPre);
|
|
|
|
|
|
MapData.cameraMarginInfo.rightMarginInPre =
|
|
|
|
|
|
EditorGUILayout.FloatField("准备前相机右间距", MapData.cameraMarginInfo.rightMarginInPre);
|
|
|
|
|
|
MapData.cameraMarginInfo.topMarginInInPre =
|
|
|
|
|
|
EditorGUILayout.FloatField("准备前相机上间距", MapData.cameraMarginInfo.topMarginInInPre);
|
|
|
|
|
|
MapData.cameraMarginInfo.bottomMarginInPre =
|
|
|
|
|
|
EditorGUILayout.FloatField("准备前相机下间距", MapData.cameraMarginInfo.bottomMarginInPre);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-21 15:30:37 +08:00
|
|
|
|
private void DrawCheckCamera()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!_isCheckingCamera && GUILayout.Button("检查相机可否超出地图"))
|
|
|
|
|
|
{
|
|
|
|
|
|
_isCheckingCamera = true;
|
|
|
|
|
|
Target.CameraController.GetComponent<Camera>().orthographicSize = Target.CameraController.CameraMaxSize;
|
2024-08-08 18:57:34 +08:00
|
|
|
|
if (_uiLevelCheck == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var ui = AssetDatabase.LoadAssetAtPath<GameObject>(UICanvasCheck);
|
|
|
|
|
|
_uiLevelCheck = Instantiate(ui);
|
|
|
|
|
|
var uiCamera = _uiLevelCheck.transform.Find("UICamera").GetComponent<Camera>();
|
|
|
|
|
|
var baseCameraData = Camera.main?.GetComponent<UniversalAdditionalCameraData>();
|
|
|
|
|
|
baseCameraData?.cameraStack.Add(uiCamera);
|
|
|
|
|
|
}
|
2024-08-12 13:01:56 +08:00
|
|
|
|
}
|
2023-12-21 15:30:37 +08:00
|
|
|
|
|
|
|
|
|
|
if (_isCheckingCamera && GUILayout.Button("退出相机检查"))
|
|
|
|
|
|
{
|
2024-08-08 18:57:34 +08:00
|
|
|
|
if (_uiLevelCheck)
|
|
|
|
|
|
DestroyImmediate(_uiLevelCheck);
|
2023-12-21 15:30:37 +08:00
|
|
|
|
_isCheckingCamera = false;
|
|
|
|
|
|
Target.CameraController.GetComponent<Camera>().orthographicSize = Target.CameraController.CameraMinSize;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (_isCheckingCamera)
|
|
|
|
|
|
{
|
|
|
|
|
|
EditorGUI.BeginChangeCheck();
|
|
|
|
|
|
_checkType = (ECameraCheckCorner)EditorGUILayout.Popup("检查角落", (int)_checkType, checkCornerType);
|
|
|
|
|
|
if (EditorGUI.EndChangeCheck())
|
2023-12-21 15:05:08 +08:00
|
|
|
|
{
|
2023-12-21 15:30:37 +08:00
|
|
|
|
switch (_checkType)
|
2023-12-21 15:05:08 +08:00
|
|
|
|
{
|
2023-12-21 15:30:37 +08:00
|
|
|
|
case ECameraCheckCorner.None:
|
|
|
|
|
|
break;
|
|
|
|
|
|
case ECameraCheckCorner.LeftDown:
|
|
|
|
|
|
var leftDownPoint = new Vector2Int(0, 0);
|
2024-08-08 18:57:34 +08:00
|
|
|
|
Target.CameraController.InitializeCameraPosition(
|
|
|
|
|
|
Map.BlockPosition2WorldPosition(leftDownPoint));
|
2023-12-21 15:30:37 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case ECameraCheckCorner.RightDown:
|
|
|
|
|
|
var rightDownPoint = new Vector2Int(0, TGS.columnCount - 1);
|
2024-08-08 18:57:34 +08:00
|
|
|
|
Target.CameraController.InitializeCameraPosition(
|
|
|
|
|
|
Map.BlockPosition2WorldPosition(rightDownPoint));
|
2023-12-21 15:30:37 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case ECameraCheckCorner.LeftUp:
|
|
|
|
|
|
var leftUpPoint = new Vector2Int(TGS.rowCount - 1, 0);
|
2024-01-12 14:17:17 +08:00
|
|
|
|
Target.CameraController.InitializeCameraPosition(Map.BlockPosition2WorldPosition(leftUpPoint));
|
2023-12-21 15:30:37 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case ECameraCheckCorner.RightUp:
|
|
|
|
|
|
var rightUpPoint = new Vector2Int(TGS.rowCount - 1, TGS.columnCount - 1);
|
2024-01-12 14:17:17 +08:00
|
|
|
|
Target.CameraController.InitializeCameraPosition(Map.BlockPosition2WorldPosition(rightUpPoint));
|
2023-12-21 15:30:37 +08:00
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
2023-12-21 15:05:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-21 15:30:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-21 15:05:08 +08:00
|
|
|
|
|
2023-12-21 15:30:37 +08:00
|
|
|
|
private void DrawCameraOriginPosition()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!_isEditingCameraOriginPos)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GUILayout.Button("编辑相机初始位置"))
|
2023-12-15 18:32:21 +08:00
|
|
|
|
{
|
2023-12-21 15:30:37 +08:00
|
|
|
|
_isEditingCameraOriginPos = true;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
}
|
2023-12-21 15:30:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
EditorGUILayout.LabelField("请在场景中点击网格来选取相机初始位置,并在Game窗口中查看");
|
|
|
|
|
|
if (GUILayout.Button("退出编辑相机初始位置"))
|
2023-12-15 18:32:21 +08:00
|
|
|
|
{
|
2023-12-21 15:30:37 +08:00
|
|
|
|
_isEditingCameraOriginPos = false;
|
2023-12-15 18:32:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-21 15:05:08 +08:00
|
|
|
|
|
|
|
|
|
|
private void OnSceneGUI()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!_isEditingCameraOriginPos)
|
|
|
|
|
|
return;
|
|
|
|
|
|
ResetSceneGUIState(Event.current);
|
|
|
|
|
|
DrawMouse();
|
|
|
|
|
|
HandleInput();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void ResetSceneGUIState(Event e)
|
|
|
|
|
|
{
|
|
|
|
|
|
_isHitGround = false;
|
|
|
|
|
|
_mouseHitPosition = Vector3.zero;
|
|
|
|
|
|
_currEvent = e;
|
|
|
|
|
|
_ground = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void DrawMouse()
|
|
|
|
|
|
{
|
|
|
|
|
|
var mousePosSS = _currEvent.mousePosition;
|
|
|
|
|
|
var ray = HandleUtility.GUIPointToWorldRay(mousePosSS);
|
|
|
|
|
|
var count = Physics.RaycastNonAlloc(ray, _hits, 1000, 1 << LayerMask.NameToLayer("Ground"));
|
|
|
|
|
|
if (count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var hit = _hits[0];
|
|
|
|
|
|
_mouseHitPosition = hit.point;
|
|
|
|
|
|
Handles.color = Color.yellow;
|
|
|
|
|
|
Handles.DrawSolidDisc(_mouseHitPosition, Vector3.up, 1);
|
|
|
|
|
|
_isHitGround = true;
|
|
|
|
|
|
_ground = hit.collider.gameObject;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void HandleInput()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!_isHitGround)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var controlID = GUIUtility.GetControlID(FocusType.Passive);
|
|
|
|
|
|
var eventType = _currEvent.GetTypeForControl(controlID);
|
|
|
|
|
|
|
|
|
|
|
|
switch (eventType)
|
|
|
|
|
|
{
|
|
|
|
|
|
case EventType.MouseDown:
|
|
|
|
|
|
if (_currEvent.button == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
GUIUtility.hotControl = controlID;
|
|
|
|
|
|
if (_isEditingCameraOriginPos)
|
|
|
|
|
|
{
|
|
|
|
|
|
var cell = TGS.CellGetAtPosition(_mouseHitPosition, true);
|
|
|
|
|
|
if (cell == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.LogError("点击点附件没有网格!设置相机初始位置失败!");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MapData.initialCameraPosition = MapData.BlockIndex2Position(cell.index);
|
2024-08-08 18:57:34 +08:00
|
|
|
|
Target.CameraController.InitializeCameraPosition(
|
|
|
|
|
|
Map.BlockPosition2WorldPosition(MapData.initialCameraPosition));
|
2023-12-21 15:05:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
case EventType.MouseUp:
|
|
|
|
|
|
if (GUIUtility.hotControl == controlID && _currEvent.button == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
GUIUtility.hotControl = 0;
|
|
|
|
|
|
_currEvent.Use();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-15 18:32:21 +08:00
|
|
|
|
}
|