/// <summary> /// Updates the accelerations and speed modifiers to those associated with the current terrain and/or medium the player is in. /// </summary> /// <param name="currentTerrain">The current Terrain the player is travelling on - if any.</param> /// <param name="currentMedium">The Current Medium the player is travelling through.</param> private void UpdateMovementAugmentations(TerrainType currentTerrain, MediumType currentMedium) { // Implies we aren't firmly standing on ground, and so the fluid we're in must be used for acceleration calculations. if (currentTerrain == TerrainType.None || currentMedium == MediumType.Water) { int mediumIndex = FindMediumIndex(currentMedium); if (mediumIndex != -1) { // Extract the relevant movement augmentation information from the correct acceleration set. currentSpeedModifier = accelerationSet[mediumIndex].moveSpeedModifier; currentAcceleration = accelerationSet[mediumIndex].acceleration; currentDecceleration = accelerationSet[mediumIndex].decceleration; } else { Debug.LogWarning("Medium " + currentMedium.ToString() + " could not be found in accelerationSet array."); // Use Default movement augmentation information from the correct acceleration set. currentSpeedModifier = 1; currentAcceleration = 1; currentDecceleration = 1; } } // implies we're firmly on some sort of ground else { int terrainIndex = FindTerrainIndex(currentTerrain); if (terrainIndex != -1) { // Extract the relevant movement augmentation information from the correct acceleration set. currentSpeedModifier = accelerationSet[terrainIndex].moveSpeedModifier; currentAcceleration = accelerationSet[terrainIndex].acceleration; currentDecceleration = accelerationSet[terrainIndex].decceleration; } else { Debug.LogWarning("Terrain " + currentTerrain.ToString() + " could not be found in accelerationSet array."); // Use Default movement augmentation information from the correct acceleration set. currentSpeedModifier = 1; currentAcceleration = 1; currentDecceleration = 1; } } }
private static string ConvertMediumType(MediumType mediumType) { switch (mediumType) { case MediumType.Paper: return(SR.LabelFilmMediumTypePaper); case MediumType.ClearFilm: return(SR.LabelFilmMediumTypeClearFilm); case MediumType.BlueFilm: return(SR.LabelFilmMediumTypeBlueFilm); case MediumType.MammoClearFilm: return(SR.LabelFilmMediumTypeMammoClearFilm); case MediumType.MammoBlueFilm: return(SR.LabelFilmMediumTypeMammoBlueFilm); default: return(mediumType.ToString()); } }
internal static string GetDisplayString(MediumType t) => t.ToString().Replace("MediumType_", "");