NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Fight/Flag/FlagInst.cs

32 lines
811 B
C#
Raw Normal View History

2024-05-31 16:46:35 +08:00
using Gameplay.Area;
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;
var sampleObj = AssetManager.Instance.GetPreLoadResult<GameObject>(Constants.FLAG_GROUND_PATH);
_displayObj = Object.Instantiate(sampleObj);
var worldPos = AreaManager.instance.GetCellPosByIndex(cellIndex);
_displayObj.transform.position = worldPos;
}
public void Dispose()
{
if (_displayObj == null) return;
_displayObj.Destroy();
_displayObj = null;
}
2024-05-30 19:23:59 +08:00
}
}