Split string, add action to every word

There is a text. Which must be split into words and to create an action to every word, when pressed, plays a sound file, specified for this word.

How to do it automatically? Let’s say I know how to split a string into words, and how to add action to every word?

I need to create gameObect according to each word and specify Rect according to a word position, then add script to interact with this Rect? But how to calculate each word position?

And maybe there are another solution?

I add a little more explanation:

I dont know how to do 1) and 2).

public class Texttext : MonoBehaviour {
    public GUIText guiText;
    public ActionOnClick actionScript;
	// Use this for initialization
	void Start () {
        guiText.text = "Text, text text!

Text? Text!
Text, text text, text…";
string split = guiText.text.Split(new char { ’ ', ‘,’, ‘.’, ‘:’, ’ ', ’
foreach (string str in split)
if (str != “”)
// Create GameObject
GameObject go = new GameObject(str);

                // 1) Calculate word position (!!!)
                Vector3 wordPosition = new Vector3(0, 0, 0);

                // 2) Create Rect according this position (!!!)
                Rect wordRect = new Rect(wordPosition.x, wordPosition.y, wordWidth,wordHeight);

                // Add action to this gameObject
                go.GetComponent<ActionOnClick>().wordPosition = wordPosition;
                go.GetComponent<ActionOnClick>().wordRect = wordRect;
	// Update is called once per frame
	void Update () {

The problem is to automate this: Write text → Calculate → Click on Word get a Sound.

And that’s what I want to get:


split a string into words,

create gameObject

specify Rect according to a word position

how to calculate each word position