Initial commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
public class InteractionManager : MonoBehaviour
|
||||
{
|
||||
private static InteractionManager instance;
|
||||
|
||||
private CommandHandler commandHandler;
|
||||
private GhostManagerV2 ghostManager;
|
||||
private SelectionManager selectionManager;
|
||||
private UIManager uiManager;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance == null) instance = this;
|
||||
else Destroy(this.gameObject);
|
||||
}
|
||||
|
||||
public static InteractionManager getInstance()
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
commandHandler = CommandHandler.getInstance();
|
||||
ghostManager = GhostManagerV2.getInstance();
|
||||
selectionManager = SelectionManager.getInstance();
|
||||
uiManager = UIManager.getInstance();
|
||||
|
||||
setupListeners();
|
||||
}
|
||||
|
||||
private void setupListeners()
|
||||
{
|
||||
uiManager.onSelectEvent.AddListener(blockData =>
|
||||
{
|
||||
ghostManager.setupBlock(blockData);
|
||||
});
|
||||
ghostManager.onClearAddListener(() =>
|
||||
{
|
||||
uiManager.deselectUIInteractable();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user