Merge remote-tracking branch 'origin/feat/inport-props' into feat/craft-discovery
# Conflicts: # Assets/External/Animated PBR Chest Demo/Materials/WoodChest.mat # Packages/com.distantlands.cozy.core/Content/Integration/Import for BiRP.unitypackage.meta # Packages/com.distantlands.cozy.core/Content/Integration/Import for HDRP.unitypackage.meta # Packages/com.distantlands.cozy.core/Content/Integration/Import for URP.unitypackage.meta
This commit is contained in:
@@ -127,13 +127,24 @@ namespace Ashwild.Player
|
||||
// ============================================================
|
||||
|
||||
public static event Action<IInteractable> InteractableHoverChanged; // null = nothing hovered
|
||||
// A world interaction (pickup, harvest) could not be carried out — payload is a short, player-facing
|
||||
// reason such as "Inventory full". Raised whenever an interaction is refused, so a refusal is never
|
||||
// silent: without it a rejected harvest looks exactly like a successful one that dropped nothing.
|
||||
public static event Action<string> InteractionRefused;
|
||||
// The local player just reached out to grab something off the ground. Raised the moment the
|
||||
// gesture is committed (all checks passed, request sent) rather than when the item lands in the
|
||||
// inventory, so the grab animation plays instantly instead of after a server round-trip.
|
||||
public static event Action GrabPerformed;
|
||||
|
||||
// ============================================================
|
||||
// Tools events
|
||||
// ============================================================
|
||||
|
||||
public static event Action AttackSwung;
|
||||
public static event Action<int> AttackSwung; // the swing started — payload is the combo variant index
|
||||
public static event Action AttackImpact; // the swing's contact frame (Animation Event) — resolve the hit here
|
||||
public static event Action<Harvestable, float> HarvestableHit;
|
||||
public static event Action EquipStarted; // play the draw animation for the item now in hand
|
||||
public static event Action UnequipStarted; // play the put-away animation for the item leaving the hand
|
||||
public static event Action EquipAnimComplete;
|
||||
public static event Action UnequipAnimComplete;
|
||||
|
||||
@@ -299,8 +310,39 @@ namespace Ashwild.Player
|
||||
InteractableHoverChanged?.Invoke(target);
|
||||
}
|
||||
|
||||
public static void RaiseAttackSwung() { Log(nameof(AttackSwung)); AttackSwung?.Invoke(); }
|
||||
/// <summary>
|
||||
/// Announces that a world interaction was refused, with a short player-facing reason. The HUD turns
|
||||
/// it into a notification so the player always learns why nothing was gained.
|
||||
/// </summary>
|
||||
public static void RaiseInteractionRefused(string reason)
|
||||
{
|
||||
if (string.IsNullOrEmpty(reason)) return;
|
||||
Log(nameof(InteractionRefused));
|
||||
InteractionRefused?.Invoke(reason);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Announces a swing, carrying which combo variant to play. The variant defaults to 0 so a plain
|
||||
/// one-swing tool never has to think about combos, while a weapon can cycle its own variants.
|
||||
/// </summary>
|
||||
public static void RaiseAttackSwung(int variant = 0) { Log(nameof(AttackSwung)); AttackSwung?.Invoke(variant); }
|
||||
|
||||
/// <summary>
|
||||
/// Announces the local player's grab gesture so the arms play their pickup animation. Owner-side
|
||||
/// only, and deliberately not tied to the item actually arriving: the server still has the final
|
||||
/// say on the pickup, but the hand should reach out the instant the player presses.
|
||||
/// </summary>
|
||||
public static void RaiseGrabPerformed() { Log(nameof(GrabPerformed)); GrabPerformed?.Invoke(); }
|
||||
|
||||
/// <summary>
|
||||
/// Announces the contact frame of a swing, raised from the attack clip's Animation Event. Items
|
||||
/// resolve their hit here rather than on the input press so the damage lands when the blade does.
|
||||
/// </summary>
|
||||
public static void RaiseAttackImpact() { Log(nameof(AttackImpact)); AttackImpact?.Invoke(); }
|
||||
|
||||
public static void RaiseHarvestableHit(Harvestable h, float d) { Log(nameof(HarvestableHit)); HarvestableHit?.Invoke(h, d); }
|
||||
public static void RaiseEquipStarted() { Log(nameof(EquipStarted)); EquipStarted?.Invoke(); }
|
||||
public static void RaiseUnequipStarted() { Log(nameof(UnequipStarted)); UnequipStarted?.Invoke(); }
|
||||
public static void RaiseEquipAnimComplete() { EquipAnimComplete?.Invoke(); }
|
||||
public static void RaiseUnequipAnimComplete() { UnequipAnimComplete?.Invoke(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user