public void NewLevel() { int MaskType = Random.Range(0, 4); int EndSceneType = Random.Range(0, 2); EndSceneType = OS.GetSaveType() == 3 ? 0 : EndSceneType; render.material.SetInt("_MaskSelected", MaskType); render.material.SetInt("_EndKind", EndSceneType); }