示例#1
0
    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());
        }
    }
示例#2
0
    /// <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");
    }