完成阻隔点

This commit is contained in:
2025-06-19 01:31:00 +08:00
parent a5da5b6d9d
commit c9984c9055
11 changed files with 2122 additions and 1368 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
@@ -19,6 +20,18 @@ public class UICellEditor : MonoBehaviour
public Button btnSetBrush;
public Button btnSaveCells;
/// <summary>
/// <20><><EFBFBD>ڱ༭<DAB1><E0BCAD><EFBFBD><EFBFBD>
/// </summary>
public CellType editorGrid { private set; get; }
public ToggleGroup editorAreaToggle;
public static UICellEditor Instance;
private void Awake()
{
Instance = this;
editorGrid = CellType.None;
}
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѱ·
public Toggle togPathTest;
public GameObject pathTestPanel;
@@ -192,7 +205,7 @@ public class UICellEditor : MonoBehaviour
//ͼ<><CDBC><EFBFBD>
public void OnShowLayerToggleChange()
{
CellLayer[] layers = (CellLayer[])Enum.GetValues(typeof(CellLayer));
CellType[] layers = (CellType[])Enum.GetValues(typeof(CellType));
_layers = 0;
for (int i= showgLayers.Length - 1; i>=0; i--)
{
@@ -209,23 +222,72 @@ public class UICellEditor : MonoBehaviour
{
MapManager.Instance.HideCells();
}
public void EditorAreaToggleChange(Toggle t)
{
if (t.isOn)
{
switch (t.name)
{
case "MoveToggle":
editorGrid = CellType.Move;
break;
case "BlockToggle":
editorGrid = CellType.Obstacle;
break;
case "HideToggle":
editorGrid = CellType.Hide;
break;
case "SafeToggle":
editorGrid = CellType.Safe;
break;
case "StallToggle":
editorGrid = CellType.Stall;
break;
}
MapManager.Instance.map?.selector.RefreshPlaneRender();
}
if (editorAreaToggle.ActiveToggles().Count() == 0)
{
Debug.Log(<><C3BB>ѡ<EFBFBD>б<D0B1><E0BCAD><EFBFBD><EFBFBD>");
editorGrid = CellType.None;
}
}
public void SetBrush()
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
/// </summary>
public void CleanSelectArea()
{
if (!UIWindow.Instance.uiCellInfo.bMapOpened)
{
UIWindow.Instance.ShowMessage("<22><><EFBFBD>ȴ򿪵<EFBFBD>ͼ");
if (editorGrid == CellType.None)
{
UIWindow.Instance.ShowMessage("<22><>ǰû<EFBFBD>пɱ༭<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
return;
}
float brushRadius = Convert.ToSingle(txtBrushRadius.text);
CellType type = (CellType)(1 << dropCellType.value);
MapManager.Instance.SetBrush(brushRadius, type);
MapManager.Instance.StartEditor();
if (!MapManager.Instance.isOpenMap())
return;
MapManager.Instance.map.selector.ClearSelectArea();
}
public void CleanSafe()
{
MapManager.Instance.CleanSafe();
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
/// </summary>
public void FullSelectArea()
{
if (editorGrid == CellType.None)
{
UIWindow.Instance.ShowMessage("<22><>ǰû<C7B0>пɱ༭<C9B1><E0BCAD><EFBFBD><EFBFBD>");
return;
}
if (!MapManager.Instance.isOpenMap())
return;
MapManager.Instance.map.selector.FullAllArea();
}
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>
/// </summary>
public void SaveObs()
{
if (!MapManager.Instance.isOpenMap())
return;
MapManager.Instance.SaveMapObs();
}
}