显示ara
This commit is contained in:
@@ -404,73 +404,21 @@ public partial class MapManager : MonoBehaviour
|
||||
|
||||
public void ShowSpecialPoint(EditCellType cellType)
|
||||
{
|
||||
Transform cellsTrans = UIWindow.Instance.mapTrans.Find("CellsNode");
|
||||
if (cellsTrans == null)
|
||||
{
|
||||
UIWindow.Instance.ShowMessage("û<><C3BB><EFBFBD>ҵ<EFBFBD>CellsNode<64>ڵ<EFBFBD>");
|
||||
return;
|
||||
}
|
||||
|
||||
int size = 0;
|
||||
string cellName = GetSpecialName(cellType, out size);
|
||||
|
||||
Transform trans = null;
|
||||
for (int i = 1; i <= size; i++)
|
||||
{
|
||||
trans = cellsTrans.Find($"{cellName}{i}");
|
||||
if (trans == null)
|
||||
continue;
|
||||
|
||||
trans.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
if(cellType == EditCellType.MonsterArea)
|
||||
{
|
||||
foreach(var item in _dicMonsterPathPointSize)
|
||||
{
|
||||
for (int i = 1; i <= item.Value; i++)
|
||||
{
|
||||
cellName = $"MonsterPath{item.Key}{i}";
|
||||
trans = cellsTrans.Find(cellName);
|
||||
if (trans == null)
|
||||
continue;
|
||||
|
||||
trans.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void HideSpecialPoint(EditCellType cellType)
|
||||
{
|
||||
Transform cellsTrans = UIWindow.Instance.mapTrans.Find("CellsNode");
|
||||
if (cellsTrans == null)
|
||||
{
|
||||
UIWindow.Instance.ShowMessage("û<><C3BB><EFBFBD>ҵ<EFBFBD>CellsNode<64>ڵ<EFBFBD>");
|
||||
return;
|
||||
}
|
||||
|
||||
int size = 0;
|
||||
string cellName = GetSpecialName(cellType, out size);
|
||||
|
||||
Transform trans = null;
|
||||
for(int i=1; i<=size; i++)
|
||||
{
|
||||
trans = cellsTrans.Find($"{cellName}{i}");
|
||||
if (trans == null)
|
||||
continue;
|
||||
|
||||
trans.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveSpecialPoint(EditCellType cellType, int idx = 0)
|
||||
{
|
||||
Transform cellsTrans = UIWindow.Instance.mapTrans.Find("CellsNode");
|
||||
if (cellsTrans == null)
|
||||
{
|
||||
UIWindow.Instance.ShowMessage("û<><C3BB><EFBFBD>ҵ<EFBFBD>CellsNode<64>ڵ<EFBFBD>");
|
||||
return;
|
||||
}
|
||||
|
||||
string cellName = string.Empty;
|
||||
switch (cellType)
|
||||
@@ -518,40 +466,17 @@ public partial class MapManager : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
if (cellsTrans.Find(cellName))
|
||||
if (mapAreaParent.Find(cellName))
|
||||
{
|
||||
DestroyImmediate(cellsTrans.Find(cellName).gameObject);
|
||||
DestroyImmediate(mapAreaParent.Find(cellName).gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void CreateSpecialPoint(int x, int y, EditCellType cellType)
|
||||
{
|
||||
Transform cellsTrans = UIWindow.Instance.mapTrans.Find("CellsNode");
|
||||
if (cellsTrans == null)
|
||||
{
|
||||
UIWindow.Instance.ShowMessage("û<><C3BB><EFBFBD>ҵ<EFBFBD>CellsNode<64>ڵ<EFBFBD>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_curOpenMapId <= 0)
|
||||
return;
|
||||
|
||||
if (cellsNode == null)
|
||||
return;
|
||||
|
||||
if (mapWidth <= 0 || mapHeight <= 0)
|
||||
return;
|
||||
if (_cellWidth <= 0 || _cellHeight <= 0)
|
||||
return;
|
||||
if (_cellRows <= 0 || _cellCols <= 0)
|
||||
return;
|
||||
|
||||
if (y < 0 || y >= _cellRows)
|
||||
return;
|
||||
if (x < 0 || x >= _cellCols)
|
||||
return;
|
||||
|
||||
UnityEngine.Object obj = null;
|
||||
|
||||
|
||||
@@ -641,14 +566,14 @@ public partial class MapManager : MonoBehaviour
|
||||
}
|
||||
|
||||
GameObject go = null;
|
||||
if (cellsTrans.Find(cellName))
|
||||
if (mapAreaParent.Find(cellName))
|
||||
{
|
||||
go = cellsTrans.Find(cellName).gameObject;
|
||||
go = mapAreaParent.Find(cellName).gameObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
go = Instantiate(obj) as GameObject;
|
||||
go.transform.SetParent(cellsTrans, false);
|
||||
go.transform.SetParent(mapAreaParent, false);
|
||||
go.transform.localScale = new Vector3(((float)_cellWidth / CELLSCALE) - 0.1f, ((float)_cellHeight / CELLSCALE) - 0.1f, 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user