88 lines
1.9 KiB
C#
88 lines
1.9 KiB
C#
using LTGame;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Framework;
|
|
using TGS;
|
|
using UnityEngine;
|
|
|
|
namespace Gameplay.Camp.Fsm
|
|
{
|
|
/// <summary>
|
|
/// 营地编辑状态
|
|
/// </summary>
|
|
public class EditCampState : BaseCampState, IMobileInputEventHandler
|
|
{
|
|
private InputInterpreter _inputInterpreter;
|
|
public EditCampState(Camp camp) : base((int)E_CampState.Edit, camp)
|
|
{
|
|
}
|
|
|
|
public override void Enter(NBaseState exitState, object param)
|
|
{
|
|
base.Enter(exitState, param);
|
|
|
|
camp.SetInfoByEdit();
|
|
|
|
if (_inputInterpreter == null)
|
|
{
|
|
_inputInterpreter = InputInterpreterFactory.CreateInterpreter(InputInterpreterType.AutoPlatform, "InputInterpreter", this);
|
|
}
|
|
}
|
|
|
|
protected override void _OnRunning()
|
|
{
|
|
base._OnRunning();
|
|
|
|
camp.UpdateEdit();
|
|
}
|
|
|
|
public override void Exit(NBaseState enterState, object param)
|
|
{
|
|
if (_inputInterpreter != null)
|
|
{
|
|
_inputInterpreter.Destroy(true);
|
|
_inputInterpreter = null;
|
|
}
|
|
|
|
camp.ExitEdit();
|
|
|
|
base.Exit(enterState, param);
|
|
}
|
|
|
|
|
|
public void OnPointerDown(Vector2 screenPosition)
|
|
{
|
|
|
|
}
|
|
|
|
public void OnPointerUp(Vector2 screenPosition)
|
|
{
|
|
|
|
}
|
|
|
|
public void OnPressMove(Vector2 delta)
|
|
{
|
|
|
|
}
|
|
|
|
public void OnTap(Vector2 screenPosition)
|
|
{
|
|
camp.OnEditClick(screenPosition);
|
|
}
|
|
|
|
public void OnLongPress(Vector2 screenPosition)
|
|
{
|
|
|
|
}
|
|
|
|
public void OnLongPressUp(Vector2 screenPosition)
|
|
{
|
|
camp.OnEditClick(screenPosition);
|
|
}
|
|
|
|
public void OnZoom(float delta)
|
|
{
|
|
|
|
}
|
|
}
|
|
} |