added WIP button for flask usage
This commit is contained in:
@@ -2,6 +2,7 @@ using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections;
|
||||
using Invector.vCharacterController;
|
||||
using TMPro;
|
||||
// We don't need the Invector vActions namespace here anymore since we use your custom Respawner
|
||||
|
||||
namespace Beyond
|
||||
@@ -18,14 +19,15 @@ namespace Beyond
|
||||
[SerializeField] private float totalAnimationDuration = 2.0f;
|
||||
|
||||
[Header("Animation")]
|
||||
[SerializeField] private string animatorTrigger = "DrinkFlask";
|
||||
[SerializeField] private string animatorStateName = "DrinkFlask";
|
||||
[SerializeField] private float transitionDuration = 0.1f;
|
||||
[Tooltip("Audio clip to play when drinking")]
|
||||
[SerializeField] private AudioClip drinkSound;
|
||||
|
||||
[Header("UI References")]
|
||||
[SerializeField] private Button uiButton;
|
||||
[SerializeField] private Image radialIconImage;
|
||||
[SerializeField] private Text countText;
|
||||
[SerializeField] private TextMeshProUGUI countText;
|
||||
|
||||
private int currentCharges;
|
||||
private float lastDrinkTime;
|
||||
@@ -137,7 +139,7 @@ namespace Beyond
|
||||
// Trigger Animation
|
||||
if (playerRef.ThirdPersonController.animator)
|
||||
{
|
||||
playerRef.ThirdPersonController.animator.SetTrigger(animatorTrigger);
|
||||
playerRef.ThirdPersonController.animator.CrossFadeInFixedTime(animatorStateName, transitionDuration);
|
||||
}
|
||||
|
||||
// Play Sound
|
||||
@@ -150,7 +152,7 @@ namespace Beyond
|
||||
currentCharges--;
|
||||
|
||||
// Accessing Invector controller health directly
|
||||
playerRef.ThirdPersonController.ChangeHealth(healAmount);
|
||||
playerRef.ThirdPersonController.AddHealth(healAmount);
|
||||
|
||||
// Wait remaining animation time
|
||||
float remainingTime = totalAnimationDuration - healDelay;
|
||||
|
||||
Reference in New Issue
Block a user