working on charging system

This commit is contained in:
2025-07-30 08:26:07 +02:00
parent 61a42bdf10
commit 407454555f
13 changed files with 544 additions and 497 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using RebootKit.Engine.Simulation;
using UnityEngine;
namespace RebootReality.jelycho.Items {
@@ -9,6 +10,13 @@ namespace RebootReality.jelycho.Items {
Sword = 2,
}
public interface IItemChargeAction {
bool OnChargeStart(Actor user, ItemActor itemActor);
void OnChargeUpdate(Actor user, ItemActor itemActor, float chargeProgress);
void OnChargeEnd(Actor user, ItemActor itemActor, float chargeProgress);
void OnChargeCancel(Actor user, ItemActor itemActor);
}
[Serializable]
public class ItemConfig {
public ItemType itemType = ItemType.Neutral;
@@ -18,7 +26,9 @@ namespace RebootReality.jelycho.Items {
[Header("Chargeable")]
public bool isChargeable = false;
public float chargeDuration = 0.5f;
public float minChargeDuration = 0.1f;
public float maxChargeDuration = 1.0f;
public float chargeCooldown = 1.0f;
[SerializeReference] public IItemChargeAction chargeAction;
}
}