title: Checking if an Vector2 is inside of the area of two other vector 2's
body: <p>this problem is quite hard to describe on my part so I will try my best at showing my problem and showing how I did it and if someone can find a better solution than i did.</p>
  <pre><code>    public bool selectcheck(Vector3 firstpos, Vector3 secondpos)
      {
          if (firstpos.x &lt; gameObject.transform.position.x &amp;&amp; firstpos.y &lt; gameObject.transform.position.y &amp;&amp; secondpos.x &gt; gameObject.transform.position.x &amp;&amp;secondpos.y &gt; gameObject.transform.position.y)
          {
              selected = true;
          }
          else if (firstpos.x &gt; gameObject.transform.position.x &amp;&amp; firstpos.y &lt; gameObject.transform.position.y &amp;&amp; secondpos.x &lt; gameObject.transform.position.x &amp;&amp; secondpos.y &gt; gameObject.transform.position.y)
          {
              selected = true;
          }
          else if (firstpos.x &lt; gameObject.transform.position.x &amp;&amp; firstpos.y &gt; gameObject.transform.position.y &amp;&amp; secondpos.x &gt; gameObject.transform.position.x &amp;&amp; secondpos.y &lt; gameObject.transform.position.y)
          {
              selected = true;
          }
          else if (firstpos.x &gt; gameObject.transform.position.x &amp;&amp; firstpos.y &gt; gameObject.transform.position.y &amp;&amp; secondpos.x &lt; gameObject.transform.position.x &amp;&amp; secondpos.y &lt; gameObject.transform.position.y)
          {
              selected = true;
          } // this checks if the positions sent is inside the unit's position
          else
          {
              selected = false;
          }
          return selected;
      } // Selected is outside as a public bool and that is used to allow the unit to respond to the player's commands and this only tells the master script that sends this to the unit that it wants it checked out and the info sent back
  </code></pre>
  <p>I know that the code looks horrendous but I was searching everywhere for something that uses only 2 points in space to check IF the unit is inside of the specified vector2</p>
  <p>btw the code works but I really think I can make it better in some way, shape or form because the game will have about 100 units, and having that many else if's at one time when you select units, is going to be very bad indeed.</p>
  <p>thanks in beforehand!</p>