title: In unity script, how to "rotate" and "rotate to" around pivot position
body: <p>in unity editor, when i enable "Pivot", gameobject will rotate around "pivot point" position, when i enable "Center", gameobject will rotate around "center point"</p>
  
  <p>but if i use script to rotate, it always rotate around "center point", for ex, here is my scene:</p>
  
  <p><a href="https://i.stack.imgur.com/A8vuL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A8vuL.png" alt="enter image description here"></a></p>
  
  <p>I use following code:</p>
  
  <pre><code>    void Start()
      {
  //        transform.rotation = Quaternion.Euler(new Vector3(0, 0, 90));
          transform.RotateAround(transform.position, new Vector3(0, 0, 1), 90);
      }
  </code></pre>
  
  <p>it rotate around "center point"</p>
  
  <p><a href="https://i.stack.imgur.com/oIiwT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oIiwT.png" alt="enter image description here"></a></p>
  
  <p><strong>if object has collider, i can get pivot point with colider.bounds, if not, how should i do?</strong></p>
  
  <p>and even worse, in some case, i hope <strong>rotate to</strong> like set rotate in unity editor inspector, i use following code:</p>
  
  <pre><code>transform.rotation = Quaternion.Euler(new Vector3(0, 0, 90))
  </code></pre>
  
  <p>I have no idea to adjust above code to rotate around pivot point</p>
  
  <p><strong>update</strong></p>
  
  <p>I think if i can "rotate", i can also impl "rotate to", so the key point is, how should i get "pivot point" that is used in RotateAround, to object has collider, I can get with colider.bounds with transform.position, to no collider object, how should i do?</p>