title: Replace material whith sprite
body: <p>How to add sprite to player material with script. I have a shop menu of player and when a like to select one sprite i like to add to player material but I don't know how to do this. I have my code but just this I don't know how to add. This is my code I made like this but don't work can someone tell me how to add <code>playersprite</code> to <code>playermaterial</code>.</p>
  
  <pre><code>public Material playerMaterial; // --&gt; (player Material)          
  public Sprite[] playerSprite;  // --&gt; (Sprite i wish to add to the player)   
  GameManager.Instance.playerMaterial = GameManager.Instance.playerSprite[index];
  
  private void SetSprite(int index)
  {
      activeSpriteIndex = index;
      GameManager.Instance.state.activeSprite = index;
      GameManager.Instance.playerMaterial = GameManager.Instance.playerSprite[index];
      spriteBuySetText.text = "Current";
      GameManager.Instance.Save();
  }
  </code></pre>