Add prototype gameplay loop with character/battlefield assets and server game APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
udx
2026-10-20 18:50:00 +08:00
co-authored by Cursor
parent 79369e4473
commit 6c64210331
833 changed files with 998079 additions and 1042 deletions
@@ -0,0 +1,22 @@
using System;
using UnityEngine;
using UnityEngine.EventSystems;
namespace HotUpdate.Gameplay
{
/// <summary>Input behaviour on authored formation buttons; creates no UI objects.</summary>
public sealed class FormationDragHandle : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{
public Func<bool> CanBegin;
public Action<PointerEventData> Begin, Move, End;
bool _dragging;
public void OnBeginDrag(PointerEventData data)
{
if (data.button != PointerEventData.InputButton.Left || CanBegin?.Invoke() != true) return;
_dragging = true; data.eligibleForClick = false; Begin?.Invoke(data);
}
public void OnDrag(PointerEventData data) { if (_dragging) Move?.Invoke(data); }
public void OnEndDrag(PointerEventData data) { if (!_dragging) return; _dragging = false; End?.Invoke(data); }
void OnDisable() { _dragging = false; }
}
}