Refactor (#1)
This commit is contained in:
@@ -4,11 +4,8 @@
|
||||
|
||||
use bevy::prelude::*;
|
||||
use bevy::time::common_conditions::on_timer;
|
||||
use bevy::window::PrimaryWindow;
|
||||
use bevy_cef::prelude::*;
|
||||
use bevy_remote::{BrpResult, RemotePlugin};
|
||||
use cef::Window;
|
||||
use serde::Deserialize;
|
||||
use std::time::Duration;
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -32,7 +32,7 @@ fn spawn_webview(
|
||||
asset_server: Res<AssetServer>,
|
||||
) {
|
||||
commands.spawn((
|
||||
CefWebviewUri("https://bevy.org/".to_string()),
|
||||
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
|
||||
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
|
||||
MeshMaterial3d(materials.add(WebviewExtendedMaterial {
|
||||
extension: CustomExtension {
|
||||
|
||||
@@ -56,7 +56,7 @@ fn spawn_github_webview(
|
||||
mut materials: ResMut<Assets<WebviewExtendStandardMaterial>>,
|
||||
) {
|
||||
commands.spawn((
|
||||
CefWebviewUri("https://github.com/not-elm".to_string()),
|
||||
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
|
||||
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
|
||||
WebviewSize(Vec2::splat(800.0)),
|
||||
MeshMaterial3d(materials.add(WebviewExtendStandardMaterial::default())),
|
||||
@@ -70,7 +70,7 @@ fn spawn_google_search_webview(
|
||||
mut materials: ResMut<Assets<WebviewExtendStandardMaterial>>,
|
||||
) {
|
||||
commands.spawn((
|
||||
CefWebviewUri("https://www.youtube.com/".to_string()),
|
||||
CefWebviewUri::new("https://not-elm.github.io/bevy_cef/"),
|
||||
WebviewSize(Vec2::splat(800.0)),
|
||||
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
|
||||
MeshMaterial3d(materials.add(WebviewExtendStandardMaterial::default())),
|
||||
|
||||
@@ -49,7 +49,7 @@ fn spawn_webview(
|
||||
) {
|
||||
commands.spawn((
|
||||
DebugWebview,
|
||||
CefWebviewUri("https://bevy.org/".to_string()),
|
||||
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
|
||||
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
|
||||
MeshMaterial3d(materials.add(WebviewExtendStandardMaterial {
|
||||
base: StandardMaterial {
|
||||
|
||||
@@ -50,7 +50,7 @@ fn spawn_webview(
|
||||
) {
|
||||
commands.spawn((
|
||||
DebugWebview,
|
||||
CefWebviewUri("https://bevy.org/".to_string()),
|
||||
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
|
||||
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
|
||||
MeshMaterial3d(materials.add(WebviewExtendStandardMaterial::default())),
|
||||
));
|
||||
|
||||
@@ -33,7 +33,7 @@ fn spawn_webview(
|
||||
mut materials: ResMut<Assets<WebviewExtendStandardMaterial>>,
|
||||
) {
|
||||
commands.spawn((
|
||||
CefWebviewUri("https://bevy.org/".to_string()),
|
||||
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
|
||||
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
|
||||
MeshMaterial3d(materials.add(WebviewExtendStandardMaterial::default())),
|
||||
));
|
||||
|
||||
@@ -16,7 +16,7 @@ fn spawn_camera_2d(mut commands: Commands) {
|
||||
|
||||
fn spawn_sprite_webview(mut commands: Commands, mut images: ResMut<Assets<Image>>) {
|
||||
commands.spawn((
|
||||
CefWebviewUri::new("https://bevyengine.org/"),
|
||||
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
|
||||
Pickable::default(),
|
||||
Sprite {
|
||||
image: images.add(Image::default()),
|
||||
|
||||
Reference in New Issue
Block a user