浏览代码

Select first Item in Inventory when Inventory Open

/main
uChema 3 年前
当前提交
8760a221
共有 5 个文件被更改,包括 14 次插入5 次删除
  1. 1
      UOP1_Project/Assets/Scripts/Characters/Config/HealthSO.cs
  2. 1
      UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs
  3. 5
      UOP1_Project/Assets/Scripts/Menu/MultiInputSelectableElement.cs
  4. 1
      UOP1_Project/Assets/Scripts/Quests/QuestManagerSO.cs
  5. 11
      UOP1_Project/Assets/Scripts/UI/Inventory/UIInventoryItem.cs

1
UOP1_Project/Assets/Scripts/Characters/Config/HealthSO.cs


public void SetMaxHealth(int newValue)
{
_maxHealth = newValue;
Debug.Log("Max Health " + _maxHealth);
}
public void SetCurrentHealth(int newValue)

1
UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs


case InteractionType.Talk:
if (_startTalking != null)
{
Debug.Log("_startTalking");
_potentialInteractions.First.Value.interactableObject.GetComponent<StepController>().InteractWithCharacter();
_inputReader.EnableDialogueInput();
}

5
UOP1_Project/Assets/Scripts/Menu/MultiInputSelectableElement.cs


public class MultiInputSelectableElement : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, ISelectHandler
{
private MenuSelectionHandler _menuSelectionHandler;
public bool isSelected = false;
private void Awake()
{
_menuSelectionHandler = transform.root.gameObject.GetComponentInChildren<MenuSelectionHandler>();

public void OnPointerExit(PointerEventData eventData)
{
isSelected = true;
}

1
UOP1_Project/Assets/Scripts/Quests/QuestManagerSO.cs


_makeWinningChoiceEvent.OnEventRaised += MakeWinningChoice;
_makeLosingChoiceEvent.OnEventRaised += MakeLosingChoice;
StartQuestline();
Debug.Log(isNewGame());
}
void StartQuestline()
{

11
UOP1_Project/Assets/Scripts/UI/Inventory/UIInventoryItem.cs


[SerializeField] private Button _itemButton = default;
[SerializeField] private Image _bgInactiveImage = default;
bool _isSelected = false;
public UnityAction<ItemSO> ItemSelected;
[SerializeField] private LocalizeSpriteEvent _bgLocalizedImage = default;

_isSelected = isSelected;
_itemPreviewImage.gameObject.SetActive(true);
_itemCount.gameObject.SetActive(true);
_bgImage.gameObject.SetActive(true);

public void SelectFirstElement()
{
_isSelected = true;
private void OnEnable()
{
if (_isSelected)
{ SelectItem(); }
}
public void HoverItem()
{
_imgHover.gameObject.SetActive(true);

public void SelectItem()
{
_isSelected = true;
if (ItemSelected != null && _currentItem != null && _currentItem.Item != null)
{

public void UnselectItem()
{
_isSelected = false;
_imgSelected.gameObject.SetActive(false);
}

正在加载...
取消
保存