public override IEnumerator GetBehaviour() { OnStart(); InteractorGameObject.GetComponent <PlayerController>().ControlsEnabled = false; yield return(new WaitForSeconds(Duration)); InteractorGameObject.GetComponent <PlayerController>().ControlsEnabled = true; OnEnd(); }
public override IEnumerator GetBehaviour() { OnStart(); PlayerInventory inventory = InteractorGameObject.GetComponent <PlayerInventory>(); InventoryItem inventoryItem = InteractedGameObject.GetComponent <InventoryItem>(); if (inventory != null && inventoryItem != null) { if (inventory.TryTake(inventoryItem)) { InteractedGameObject.SetActive(false); yield return(new WaitForSeconds(Duration)); } } OnEnd(); }
protected void OnEnd() { InteractorGameObject.GetComponent <PlayerActionsManager>().ActionFinished(); }