title: Set class' bool permanently from outside the class
body: <p>I am trying use a class (second in code below) to change a boolean in another class (first one in code below) to true through a switch statement. I think the problem is once the program exits the switch scope, the boolean doesn't stay to it's changed value but I'm not sure why.</p>
  <pre><code>//first class 
  public bool HasStrike
          {
              get { return hasStrike; }
              set
              {
                  if (value == true)
                  {
                      Debug.Log(&quot;HasStrike set to true&quot;);
                      hasStrike = value;
                  }
                  else if (value == false)
                  {
                      Debug.Log(&quot;hasStrike set to false&quot;);
                      hasStrike = value;
                  }
  
              }
  
          }
  
  public void Strike()
          {
              if (chance[1] &gt;= 10)
              {
                  this.HasStrike = true;
                  chance[1] = 10;
              }
          }
  </code></pre>
  <pre><code>//second class
   IEnumerator WaitforFallingPins()
      {
          yield return new WaitForSeconds(10.0f);
          gameStatus.frame[gameStatus.currentFrame].Strike();
          NextChance(ref gameStatus.frame[gameStatus.currentFrame]);
      }
  
   void NextChance(ref GameStatus.frame currentFrame)
      {
          switch (gameStatus.currentChance)
          {
              case 1:
                if (currentFrame.hasStrike)
                  {
                      bowlingSet.SetAllPins();
                      Debug.Log(&quot;Strike has happened&quot;);
                      break;
                  }
  
                  else 
                  {
                      Debug.Log(&quot;this is not a strike&quot;);
                      gameStatus.currentChance += 1;
                      break;
                  }
          }
      }
  </code></pre>
  <p>In the switch statement, it always goes to the else statement even though it was set to true and I got the debug.log for true printed from the set property.</p>
  <p>For more context: This is a bowling game. Gamestatus is the game manager script that has a array of frames and each frame has HasStrike and Strike(). Gamestatus keeps track of what frame we are in and what chance (each time you roll the ball) we are in. After pins are hit, NextChance happens so that the frame can decide if it had a strike or not. The frame class is also inside the gamestatus class.</p>