Adds Feijao's interaction work, implementing the ability for players to interact with items.
The inheritance tree is MonoBehaviour > IInteractable > Interactable > script, where:
Interactable is an abstract class that handles all the heavy lifting, and contains the inspectable customisation attributes. Interactable cannot be used by itself; since it's abstract, it implements no behaviour.
the script is a custom behaviour script that is added to a gameobject, that defines the actual interaction behaviour by implementing the abstract onInteraction method.
An interaction script should feel fairly familiar to anyone who's made a monobehaviour script:
/// <summary>
/// An example of an object which can be interacted with. <br/>
/// Shows a dialog when interacted with.
/// </summary>
public class OBJ : Interactable
{
public override void onInteract()
{
Debug.Log("Object was interacted with.");
TempDialogue.ShowMessage("Object was interacted with");
}
}
The testing environment now has an intractable script on a testing object and NPC which show a temporary dialog box.
closes #37 closes #38 closes #39 closes #40
Adds Feijao's interaction work, implementing the ability for players to interact with items.
The inheritance tree is
MonoBehaviour > IInteractable > Interactable > script
, where:Interactable
is an abstract class that handles all the heavy lifting, and contains the inspectable customisation attributes.Interactable
cannot be used by itself; since it's abstract, it implements no behaviour.script
is a custom behaviour script that is added to a gameobject, that defines the actual interaction behaviour by implementing the abstractonInteraction
method.An interaction script should feel fairly familiar to anyone who's made a monobehaviour script:
The testing environment now has an intractable script on a testing object and NPC which show a temporary dialog box.
https://user-images.githubusercontent.com/50697488/104861038-1754e100-5926-11eb-817c-32bdbed5c9e2.mov