public static String GetName(this GameBuildingType type) { switch (type) { case GameBuildingType.PowerPlant: return("Power Plant"); case GameBuildingType.ScienceLab: return("Science Lab"); default: return(type.ToString()); } }
/// <summary> /// Return the path to a GameBuilding scene based on its type /// </summary> /// <param name="type"></param> /// <returns></returns> public static string GetScenePath(this GameBuildingType type) { var folder = type.IsDefenseBuilding() ? "DefenseBuildings" : "ResourceBuildings"; return($"res://src/GameObjects/{folder}/{type.ToString()}.tscn"); }