// // GET: /Resource/ public ActionResult Resource() { var DataSource = ResourceDataSource.GetData(); ViewBag.datasource = DataSource; var Resources = ResourceList.GetData(); ViewBag.resources = Resources; return(View()); }
// We override this to assign a WebSession to the WebUIComponent, // before it goes live. The component will go live after Start. protected override void Awake() { if ( Application.isEditor ) return; if ( !webUI ) return; // Get or create an in-memory WebSession. if ( session == null ) { session = WebCore.CreateWebSession( new WebPreferences() { SmoothScrolling = true } ); UnityEngine.Debug.Log( "Created In-Memory Session" ); } if ( session.GetDataSource( "media" ) == null ) { // Create and add a ResourceDataSource. This will be used to load assets // from the resources assembly (AwesomiumSampleResources) available with this sample. ResourceDataSource dataSource = new ResourceDataSource( ResourceType.Embedded, typeof( AwesomiumSampleResources.Loader ).Assembly ); session.AddDataSource( "media", dataSource ); UnityEngine.Debug.Log( "Added DataSource" ); } // Assign the WebSession to the WebUIComponent. webUI.WebSession = session; UnityEngine.Debug.Log( String.Format( "WebSession Assigned to {0}.", barType ) ); }