chunk 1: core gameplay scripts scenes runtime assets
This commit is contained in:
34
Assets/Scripts/Managers/EventSystemManager.cs
Normal file
34
Assets/Scripts/Managers/EventSystemManager.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class EventSystemManager : Singleton<EventSystemManager>
|
||||
{
|
||||
[Header("Component References")]
|
||||
public EventSystem eventSystem;
|
||||
public InputSystemUIInputModule inputSystemUIInputModule;
|
||||
|
||||
public void SetCurrentSelectedGameObject(GameObject newSelectedGameObject)
|
||||
{
|
||||
eventSystem.SetSelectedGameObject(newSelectedGameObject);
|
||||
Button newSelectable = newSelectedGameObject.GetComponent<Button>();
|
||||
newSelectable.Select();
|
||||
newSelectable.OnSelect(null);
|
||||
}
|
||||
|
||||
public void UpdateActionAssetToFocusedPlayer()
|
||||
{
|
||||
//PlayerController focusedPlayerController = GameObject.Find("GameManager").GetComponent<GameManager>().GetFocusedPlayerController();
|
||||
//inputSystemUIInputModule.actionsAsset = focusedPlayerController.GetActionAsset();
|
||||
}
|
||||
|
||||
public InputActionAsset GetInputActionAsset()
|
||||
{
|
||||
return inputSystemUIInputModule.actionsAsset;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user