Ejemplo n.º 1
0
        public static Application CreateFromPrecompiledTemplates(TemplateSettings templateSettings, Camera camera, Action <UIElement> onRegister)
        {
            ResourceManager resourceManager = new ResourceManager();

            templateSettings.resourceManager = resourceManager;

            GameApplication retn = new GameApplication(true, templateSettings, resourceManager, onRegister);

            retn.Initialize();

            retn.SetCamera(camera);

            return(retn);
        }
Ejemplo n.º 2
0
        public void Start()
        {
            type = Type.GetType(typeName);
            if (type == null)
            {
                return;
            }

            TemplateSettings settings = GetTemplateSettings(type);

            settings.materialAssets = GetComponent <UIForiaAssets>()?.materialReferences;

#if UNITY_EDITOR
            application = usePreCompiledTemplates
                ? GameApplication.CreateFromPrecompiledTemplates(settings, camera, DoDependencyInjection)
                : GameApplication.CreateFromRuntimeTemplates(settings, camera, DoDependencyInjection);
#else
            application = GameApplication.CreateFromPrecompiledTemplates(settings, camera, DoDependencyInjection);
#endif
        }