void Start() { inventory = GameObject.FindGameObjectWithTag("Player").GetComponent <InventoryController>(); items = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <MouseController>(); cameraTransform = Camera.main.gameObject.transform; }
public void BindCommandToButton(Button button, ICommand command, InventoryController inventoryController) { buttonToCommand.Add(button, command); button.onClick.AddListener(() => buttonToCommand[button]?.Execute(inventoryController)); }
public virtual void Update(InventoryController controller) { ICommand input = HandleInput(); input?.Execute(controller); }