2024-05-31 16:46:35 +08:00
|
|
|
|
using Gameplay.Area;
|
2024-11-05 13:11:26 +08:00
|
|
|
|
using Gameplay.Common;
|
2024-05-31 16:46:35 +08:00
|
|
|
|
using PhxhSDK;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using Constants = Framework.Constants;
|
|
|
|
|
|
namespace Gameplay.Fight.Flag
|
2024-05-30 19:23:59 +08:00
|
|
|
|
{
|
|
|
|
|
|
public class FlagInst
|
|
|
|
|
|
{
|
2024-05-31 16:46:35 +08:00
|
|
|
|
|
|
|
|
|
|
public int cellIndex;
|
|
|
|
|
|
|
|
|
|
|
|
private GameObject _displayObj;
|
2024-05-30 19:23:59 +08:00
|
|
|
|
|
2024-05-31 16:46:35 +08:00
|
|
|
|
public FlagInst(int cellIndex)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.cellIndex = cellIndex;
|
2024-11-05 13:11:26 +08:00
|
|
|
|
var sampleObj = AssetManager.Instance.GetPreLoadResult<GameObject>(PathDefine.HoldFlag.FLAG_GROUND_PATH);
|
2024-05-31 16:46:35 +08:00
|
|
|
|
_displayObj = Object.Instantiate(sampleObj);
|
2024-11-15 14:32:41 +08:00
|
|
|
|
var worldPos = AreaManager.instance.GetWorldPosByIndex(cellIndex);
|
2024-05-31 16:46:35 +08:00
|
|
|
|
_displayObj.transform.position = worldPos;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_displayObj == null) return;
|
|
|
|
|
|
_displayObj.Destroy();
|
|
|
|
|
|
_displayObj = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-30 19:23:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|