我有三个班级,像这样:
父类VeggiesLevel
public partial class VeggiesLevel : Level
{
private IEnumerator win_cr()
{
this.carrotDied = true;
yield return CupheadTime.WaitForSeconds(this, 1f);
this.properties.WinInstantly();
yield break;
}
public bool carrotDied;
}
子类VeggiesLevelOnion
,此子类稍后会被销毁。它会创建一个孩子VeggiesLevelOnionHomingHeart
public partial class VeggiesLevelOnion : LevelProperties.Veggies.Entity
{
private void BashfulAnimComplete()
{
this.homingHeartPrefab.CreateRadish().level = this.level;
}
public VeggiesLevel level;
}
这是孩子VeggiesLevelOnionHomingHeart
的孩子。我希望将其在carrotDied
的{{1}}上的VeggiesLevel
true
但是无论我做什么,布尔值都不会在我检查public partial class VeggiesLevelOnionHomingHeart : AbstractProjectile
{
private IEnumerator checkDeath_cr()
{
while (!this.level.carrotDied)
{
yield return null;
}
this.Death();
yield break;
}
public VeggiesLevel level;
}
时更新。我在做什么错了?