Example #1
0
    public override IEnumerator GetBehaviour()
    {
        OnStart();
        InteractorGameObject.GetComponent <PlayerController>().ControlsEnabled = false;

        yield return(new WaitForSeconds(Duration));

        InteractorGameObject.GetComponent <PlayerController>().ControlsEnabled = true;
        OnEnd();
    }
Example #2
0
    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();
    }
Example #3
0
 protected void OnEnd()
 {
     InteractorGameObject.GetComponent <PlayerActionsManager>().ActionFinished();
 }