Exemple #1
0
    //requires object to have worldobjectcontroller
    //should be called when wallobjectcontroller.interact returns false or is not called
    private bool InteractObject(Coords2 coords, Player player)
    {
        GameObject tile = GetWorldObject(coords);

        if (tile == null)
        {
            return(false);
        }

        WorldObjectController controller = tile.GetComponent <WorldObjectController>();

        if (controller == null)
        {
            return(false);
        }

        return(controller.Interact(coords, player));
    }
 public override bool Interact(Coords2 coords, Player player)
 {
     return(ownerController.Interact(coords, player));
 }