Unity - 精灵在场景视图中消失,但不是游戏视图

Unity - Sprites Go Away In Scene View, But Not Game View

编码语言:C#

经验:我了解基础知识

我目前正在尝试制作一款 2D unity 游戏,目标是打破方块。为了实现这一点,精灵使用了一个“生命值”系统,然后在生命值归零时删除它自己。 但是,出于某种奇怪的原因,Unity 会在游戏视图中保持精灵加载。它在我的场景视图中消失了,所以我知道它正在工作。它不会在我的游戏视图中消失。我曾尝试为 SpriteRenderer 组件搜索某种刷新,但我似乎找不到任何东西。

     private void Start()
{
    if (depthMultiplier == 0)
    {
        hitPoints = 3;
    }
}

void OnMouseDown()
{
    hitPoints -= 1;
    Debug.Log(hitPoints);
    if (hitPoints == 0)
    {
        GameObject.Find("PlayingScreen").GetComponent<Spendables>().gold += 1;
        Destroy(gameObject);
    }
}

}

我目前使用的代码

Sprites go away in scene view, but not game view.

编辑 - 可能一文不值,我使用的是正交相机,对象也从层次结构中删除

好的,解决了我自己的问题。摆弄相机一段时间后,我找到了 清除标志 属性。显然,我只是将其关闭而不是更改天空盒。

Clear Flags Property