title: SetAllDirty() not working at runtime in Unity?
body: <p><strong>Edit:</strong></p>
  
  <p>After doing a little more debugging I found that it doesn't work only when I start the game and have the panel/canvas that it sits on disabled. If I have the panel/canvas enabled the whole time then it redraws correctly. However, this obviously isn't a proper solution because I can't show the results before the end of the quiz. I need the panel to be disabled so that I can show it later after the end of the quiz.<strong>Is there a reason this is happening? How can I fix this?</strong></p>
  
  <p><strong>End Edit</strong></p>
  
  <p>So I found a script on GitHub that basically creates a UI polygon. It works great in the Editor, however, I want to modify it at runtime. From everything I read all I need to do is call the method <code>SetAllDirty()</code> and it will update the MaskableGraphic and Redraw it. However, whenever I call it, nothing happens.  <code>SetVerticesDirty()</code> also did not work. Can someone see where I am going wrong here.</p>
  
  <p>All I am doing is calling <code>DrawPolygon</code> and giving it <code>4 sides</code>, and passing a <code>float[5]</code> I modified it so that right after I finish setting up my new variables I call <code>SetAllDirty()</code></p>
  
  <p>Something like this:</p>
  
  <pre><code>public void DrawPolygon(int _sides, float[] _VerticesDistances)
  {
      sides = _sides;
      VerticesDistances = _VerticesDistances;
      rotation = 0;
      SetAllDirty();
  }
  </code></pre>
  
  <p>Like I said, it works fine in the editor(not runtime), and I am also getting all the values passed to the script correctly(during runtime), but it is not redrawing. As soon as I manipulate something in the inspector it will redraw to the correct shape. </p>
  
  <p>The rest of the script is posted here:</p>
  
  <p><a href="https://github.com/CiaccoDavide/Unity-UI-Polygon/blob/master/UIPolygon.cs" rel="nofollow noreferrer">https://github.com/CiaccoDavide/Unity-UI-Polygon/blob/master/UIPolygon.cs</a></p>
  
  <p>This is the method that I call <code>DrawPolygon</code> from on a Manager script. I see in the log that it prints out the statement, Quiz has ended.</p>
  
  <pre><code>void EndQuiz()
  {
      Debug.Log("Quiz has ended.");
      QuizPanel.SetActive(false);
      ResultsPanel.SetActive(true);
  
      float[] Vertices = new float[5] { score1, score2, score3, score4, score1};
  
      resultsPolygon.DrawPolygon(4, Vertices);
  
  }
  </code></pre>