title: Detect if I clicked on a certain part of text
body: <p>I'm using Unity to create an Android/IOS application.</p>
  
  <p>In a page containing a paragraph, I want to know if I click on the last sentence of the text. ("Click here for more details" for example).
  After clicking on this sentence I want to open a new page.</p>
  
  <p>I know I can put 2 text elements and add this sentence to the second element and the reset to the first element and add onClick event on the second element.</p>
  
  <p>This is a solution for the problem, but in my case, it can't solve the problem because I am getting text dynamically and its size will change from time to time, so the second text element will not start on the same line after the first element ends.</p>
  
  <p>I need a solution that is done in code.</p>
  
  <p>I saw the <a href="https://stackoverflow.com/questions/56131773/detect-click-on-text-part-of-a-block-element">same question</a> but it is for HTML and JavaScript, not for Unity.</p>
  
  <p>I will post one of the answer's code snippet which has the same behaviour of what I want. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const clickables = document.querySelectorAll('.clickable')
  clickables.forEach(el =&gt; new Clickable(el))
  
  function Clickable (el) {
    const _handleClick = ({target}) =&gt; console.log(target.innerHTML)
    const texts = el.textContent.split(/\s/)
    
    el.innerHTML = ''
    
    texts.forEach(t =&gt; {
      const span = document.createElement('span')
      span.innerHTML = `${t} `
      span.addEventListener('click', _handleClick)
      el.appendChild(span)
    })
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;h1 class="clickable"&gt;Some text&lt;/h1&gt;
  
  &lt;h2 class="clickable"&gt;Some! more! text2&lt;/h1&gt;</code></pre>
  </div>
  </div>
  </p>