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

        yield return(new WaitForSeconds(Duration));

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