次のような設定クラスがあります。
public class Settings
{
string resourcePath;
public string ResourcePath {
get {
return resourcePath + "/";
}
set {
resourcePath = value;
}
}
string texturePath;
public string TexturePath {
get {
string a = resourcePath + "/"; // This is just some debug stuff I did trying to find out wtf is going on
string b = texturePath + "/";
return a + b; // Breakpointing here shows that it is "Content/Textures/"
}
set {
texturePath = value;
}
}
public Settings ()
{
resourcePath = "Content";
texturePath = "Textures";
}
public static Settings CurrentSettings = new Settings();
}
次に、次のように、そこから TexturePath を取得しようとします。
string path = Settings.CurrentSettings.TexturePath + file;
プロパティによって返される文字列は"Content//Content/Textures//"
ここで何が欠けていますか?なぜそれをするのですか?私の知る限り、それは戻るはずですContent/Textures/