title: Using Getters and Setters in Unity
body: <p>I have another question about this with getters and setters. Now that I started working with c# getters and setters as I understood them. The problem I see is that why should I make public variable that looks like this:</p>
  
  <pre><code>// Variable
  private int _iRandomNumber
  // Getter and setter
  public int iRandomNumber
  {
       get { return _iRandomNumber; }
       set { _iRandomNumber = value; }
  
  }
  </code></pre>
  
  <p>I don't see the point of that since what different would it then be to just make the variable public since it's anyway got the get and set in the same bracket?</p>
  
  <p>However if I do like this:</p>
  
  <pre><code>// Variable
  private int _iRandomNumber
  // Getter and setter
  public int GetiRandomNumber { get { return _iRandomNumber; } }
  public int SetiRandomNumber { set { _iRandomNumber = value; } }
  </code></pre>
  
  <p>Then when I try to use my SetiRandomNumber by itself Unity complier complains that I cannot use my SetProperty since I do not have a GET property inside my SET. Should I really have to make it like the first example I wrote because as I wrote then what's the point of Getters and Setters in c#?</p>
  
  <p>Or should I instead move away from them, like I asked from the beginning and make functions for each Get and Set like in c++ so I can actually use them by themself?</p>
  
  <p>Sorry for making this a new question, however it was not possible to add this as a comment in my previous question since it was to long. </p>