public void Set(GraphicQualitySettings GQS) { /* * * switch (GQS) * { * case GraphicQualitySettings.Low: * * * * * break; * case GraphicQualitySettings.Medium: * * * break; * * case GraphicQualitySettings.High: * myLabel.Key = "High"; * break; * default: * break; * } * myLabelShadow.Key = myLabel.Key; * //myLabel */ if (MyCondition == GQS) { sprite.color = SelectedColor; disabled = true; } }
void SetAll(GraphicQualitySettings GQS) { QualitySelector[] QSs = GameObject.FindObjectsOfType <QualitySelector>(); for (int i = 0; i < QSs.Length; i++) { QSs[i].Set(GQS, LowSpritePath, true); } }
public void Set(GraphicQualitySettings QS, string LowSpritePath, bool CalledFromEditor = false) { if (LowSpritePath == "") { if (GameConfig.s == null) { return; } LowSpritePath = GameConfig.s.LowIMGPath; } switch (QS) { case GraphicQualitySettings.Low: ActiveQuality(LowGO); DisableQuality(MediumGO, LowGO, CalledFromEditor); DisableQuality(HighGO, LowGO, CalledFromEditor); break; case GraphicQualitySettings.Medium: ActiveQuality(MediumGO); DisableQuality(LowGO, MediumGO, CalledFromEditor); DisableQuality(HighGO, MediumGO, CalledFromEditor); break; case GraphicQualitySettings.High: ActiveQuality(HighGO); DisableQuality(LowGO, HighGO, CalledFromEditor); DisableQuality(MediumGO, HighGO, CalledFromEditor); break; default: break; } if (isARoad) { GetComponent <RoadEntity>().ChangeVisuals(GetComponent <RoadEntity>().direction, QS, LowSpritePath); } QualitySelector.InstaceFinished(); }
/// <summary> /// Cambia el material de la carretera /// </summary> /// <param name="dir"></param> public void ChangeVisuals(RoadDirection dir, GraphicQualitySettings GQS = GraphicQualitySettings.None, string LowIMGPath = "") { if (isClickable && TypeOfRotation == RoadRotationType.Green) { dir = RoadDirection.NE; } if (isClickable && TypeOfRotation == RoadRotationType.Blue) { dir = RoadDirection.EW; } if (LowIMGPath == "") { if (GameConfig.s == null) { LowIMGPath = "IMG\\LowIMGs\\"; } if (GameConfig.s != null) { LowIMGPath = GameConfig.s.LowIMGPath; } } if (GQS == GraphicQualitySettings.None) { if (sProfileManager.ProfileSingleton == null) {//we are probably at editor time, we change all roads ChangeVisuals(dir, GraphicQualitySettings.High, LowIMGPath); ChangeVisuals(dir, GraphicQualitySettings.Low, LowIMGPath); //Debug.Log("ChangingVisuals: EditorTime"); return; } else { //Debug.Log("ChangingVisuals: PlayTime"); GQS = sProfileManager.ProfileSingleton.GlobalGraphicQualitySettings; } } else { //Debug.Log("ChangingVisuals: PlayTime 2 "+ dir.ToString()); } if (PermanentVisuals) { return; } switch (GQS) { case GraphicQualitySettings.Low: //Low Quality using old Materials Sprite sprite = (Sprite)Resources.Load <Sprite>(LowIMGPath + "sprite_" + roadDirToString(dir)); if (myRoadLow != null) { myRoadLow.sprite = sprite; } break; case GraphicQualitySettings.Medium: Sprite sprite1 = (Sprite)Resources.Load <Sprite>(LowIMGPath + "sprite_" + roadDirToString(dir)); if (myRoadLow != null) { myRoadLow.sprite = sprite1; } break; case GraphicQualitySettings.High: //High Quality using PicaVoxel if (myRoad != null) { myRoad.SetFrame((int)dir); } break; default: break; } }