public override void Prewarm()
        {
            base.Prewarm();

            if (scene != null)
            {
                sceneObjects = UnityAPI.Await
                               (
                    () =>
                    UnityObjectUtility
                    .FindObjectsOfTypeInScene(type, scene.Value)
                    .Where(uo => predicate?.Invoke(uo) ?? true)
                    .ToDictionary(uo => uo, uo => uo.name)
                               );
            }

            if (allowAssetObjects)
            {
                assetObjects = UnityAPI.Await
                               (
                    () => AssetUtility.FindAllAssetsOfType(type)
                    .Where(uo => predicate?.Invoke(uo) ?? true)
                    .ToDictionary(uo => uo, uo => uo.name)
                               );
            }
        }
Esempio n. 2
0
 public static IEnumerable <object> FindAllSceneStubs()
 {
     return(UnityObjectUtility.FindObjectsOfTypeInAllScenes <IAotStubbable>()
            .SelectMany(aot => aot.aotStubs));
 }