Search Unity

Suggestions for firing an event/calling a method based on a character dialog selection.

Discussion in 'Scripting' started by TheLurkingDev, May 27, 2015.

  1. TheLurkingDev

    TheLurkingDev

    Joined:
    Nov 16, 2009
    Posts:
    91
    I am working on a simple dialog system that currently loads dialog on a per-character basis from text files (I may change these to JSON). The one sticking point I have is finding a good way to fire an event or call a method based on a player's dialog selection.

    The two ways that I am aware of are through reflection and through messy conditional branching (at least it's messy when I do it) based on the option chosen.

    I would love to get some suggestions on this if you could take a minute to provide one. Thank you!
     
  2. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    969