title: Changing sprite frame on mouseEnter in Unity
body: <p>I have an assets file under the name of play-button with <code>texture type=sprite2D</code> and <code>Sprite Mode = Multiple</code>, it contains 2 different frames: <code>play-button0</code> and <code>play-button1</code></p>
  
  <p>i have attached a c# script file for this asset with the following code:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class Play_btn : MonoBehaviour {
  
      SpriteRenderer spriteRenderer;
      Sprite s1;
      Sprite s2;
      // Use this for initialization
      void Start () {
          spriteRenderer = GetComponent&lt;SpriteRenderer&gt;();
          if (spriteRenderer.sprite == null)
                          spriteRenderer.sprite = s1;
      }
      void OnMouseDown() {
          Application.LoadLevel("Levels");
      }
      void OnMouseEnter() {
          spriteRenderer.sprite = s2;
      }
      void OnMouseExit() {
          //spriteRenderer.sprite = sprite1;
      }
      // Update is called once per frame
      void Update () {
  
      }
  }
  </code></pre>
  
  <p>As you can see i am trying to change the frame <code>onMouseEnter</code> and <code>OnMouseExit</code> but when the <code>mouseEnter</code> the play button a null reference error is occurring and a blank object is displaying on the screen, can anyone help me in this problem?   </p>