MoTaForPSVita/Assets/Scripts/Event/Item/EventItemBottle2.cs

20 lines
728 B
C#
Raw Normal View History

2024-04-30 17:39:50 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class EventItemBottle2 : MonoBehaviour, IInteraction
{
public bool Interaction()
{
int itemId = 6;
int giveHealth = 500;
GameManager.Instance.PlayerManager.PlayerInfo.Health += giveHealth;
GameManager.Instance.UIManager.ShowInfo($"使用 {GameManager.Instance.ResourceManager.GetResourceInfo(EResourceType.Item, itemId).Name} 1 个,恢复 {giveHealth} 点生命值。");
GameManager.Instance.BackpackManager.ConsumeItem(itemId);
// 音频播放
GameManager.Instance.SoundManager.PlaySound(ESoundType.Effect, "GiveHealth");
return false;
}
}