У меня есть вопрос, который может быть очень маленьким, но я застрял на нем последние 3 дня. У меня есть метод под названием ApplyRules, который используется очень часто, поэтому я не могу определить его внутри, но когда я пытаюсь определить его вне метода, он не читает его. Вот мой код:C# Логический внешний метод не будет читать
public bool solvedp1 = false;
public static void ApplyRules()
{
if (Level.Rooms[0, 0].GetItem("Red Gem") != null
& Level.Rooms[1, 0].GetItem("Blue Gem") != null
& solvedp1 == false)
{
Console.Clear();
Console.WriteLine("You put the gem in its correct place. As soon as the gem is in position, you feel a shiver and a warm feeling enters your toes and passes through your whole body. The strange feeling in the room is gone. You hear a lock unlocking and a door shrieking as it opens..");
Console.WriteLine("Press enter to continue");
Console.ReadKey();
solvedp1 = true;
}
Попробуйте назначить статическое ключевое слово для переменной solvep1 bool. –
Решила поблагодарить вас –