Skip to content

Commit 48b9550

Browse files
Merge pull request #111 from YousicianGit/fix/CheckInstallerPrefabTypes
Fixed CheckInstallerPrefabTypes with Unity 2018.3 and later
2 parents 2b56e19 + c0288c4 commit 48b9550

File tree

1 file changed

+2
-6
lines changed
  • UnityProject/Assets/Plugins/Zenject/Source/Install/Contexts

1 file changed

+2
-6
lines changed

UnityProject/Assets/Plugins/Zenject/Source/Install/Contexts/Context.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,12 @@ void CheckInstallerPrefabTypes(List<MonoInstaller> installers, List<MonoInstalle
109109
Assert.IsNotNull(installer, "Found null installer in Context '{0}'", name);
110110

111111
#if UNITY_EDITOR
112-
#if UNITY_2019_1_OR_NEWER
113-
// TODO - Is there a way to check this using GetPrefabAssetType in 2019+?
114-
#else
115-
#if UNITY_2018_3
116-
Assert.That(PrefabUtility.GetPrefabAssetType(installer.gameObject) == PrefabAssetType.NotAPrefab,
112+
#if UNITY_2018_3_OR_NEWER
113+
Assert.That(!PrefabUtility.IsPartOfPrefabAsset(installer.gameObject),
117114
#else
118115
Assert.That(PrefabUtility.GetPrefabType(installer.gameObject) != PrefabType.Prefab,
119116
#endif
120117
"Found prefab with name '{0}' in the Installer property of Context '{1}'. You should use the property 'InstallerPrefabs' for this instead.", installer.name, name);
121-
#endif
122118
#endif
123119
}
124120

0 commit comments

Comments
 (0)