我创建了一个内部装有CanvasGroup组件的预制件。当我实例化它时,即使在预制中将其alpha设置为1,它的alpha也变为0。
RemoteDiffMenu remoteDiffPrefab = Resources.Load<RemoteDiffMenu>("Prefabs/Utils/UI/RemoteDiff");
RemoteDiffMenu remoteDiff = Instantiate(remoteDiffPrefab, transform);
它是在另一个CanvasGroup下实例化的。
SettingsMenu和RemoteDiff都包含一个CanvasGroup
RemoteDiff的画布组: