48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
using System;
|
|
using Cysharp.Threading.Tasks;
|
|
using LTGame;
|
|
using PhxhSDK;
|
|
using TGS;
|
|
using UnityEngine;
|
|
|
|
namespace Gameplay.LegionBattle
|
|
{
|
|
public class LegionBattleStateBattle : BaseLegionBattleState
|
|
{
|
|
|
|
public LegionBattleStateBattle(LegionBattle legionBattle) : base(legionBattle, E_LegionBattleState.Battle)
|
|
{
|
|
}
|
|
|
|
protected override void _OnEnter(NBaseState exitState, object param)
|
|
{
|
|
MapData.CameraInfo cameraInfo = legionBattle.Map.MapData.cameraMarginInfo;
|
|
CameraManager.Instance.MainCamera.GetComponent<CameraController>().rightMargin = cameraInfo.rightMarginInPre;
|
|
CameraManager.Instance.MainCamera.GetComponent<CameraController>().leftMargin = cameraInfo.leftMarginInPre;
|
|
CameraManager.Instance.MainCamera.GetComponent<CameraController>().topMargin = cameraInfo.topMarginInInPre;
|
|
CameraManager.Instance.MainCamera.GetComponent<CameraController>().bottomMargin = cameraInfo.bottomMarginInPre;
|
|
Debug.Log("开始战斗");
|
|
}
|
|
|
|
protected override void OnClick(Vector2 screenPosition)
|
|
{
|
|
int clickCellIndex = GroundHitHelper.CalcHitCellIndex(screenPosition, legionBattle.Map.TerrainGridSystem);
|
|
if (clickCellIndex < 0)
|
|
return;
|
|
|
|
CheckCellClick(legionBattle.Map.TerrainGridSystem, clickCellIndex, 0);
|
|
}
|
|
|
|
protected override void OnCellClick(TerrainGridSystem tgs, int cellIndex, int buttonIndex)
|
|
{
|
|
if (InputManager.Instance.HandledThisFrame())
|
|
return;
|
|
|
|
Map map = legionBattle.Map;
|
|
if (null == map)
|
|
return;
|
|
|
|
DebugUtil.Log($"点击区域索引:{cellIndex}");
|
|
}
|
|
}
|
|
} |