public void SetMaterial() { int index = PlayerPrefs.GetInt(IPScrollView.INDEX); // SetMaterial (index); Debug.Log("Index = " + index); player.GetComponent <Renderer> ().material = playerMaterial [index]; }