@ -1,4 +1,6 @@
|
||||
#unityContainer{ |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
} |
||||
|
||||
|
@ -1,19 +1,37 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
declare var UnityLoader: any; |
||||
declare var UnityProgress: any; |
||||
|
||||
|
||||
@Component({ |
||||
selector: 'app-unity', |
||||
templateUrl: './unity.component.html', |
||||
styleUrls: ['./unity.component.scss'] |
||||
}) |
||||
|
||||
|
||||
|
||||
export class UnityComponent implements OnInit { |
||||
|
||||
constructor() { } |
||||
public unityInstance: any = {}; |
||||
|
||||
constructor() { |
||||
// window.GetName = window.GetName || {};
|
||||
// window.GetName = this.GetName.bind(this);
|
||||
} |
||||
|
||||
progressValue = 0; |
||||
|
||||
ngOnInit(): void { |
||||
UnityLoader.instantiate('unityContainer', 'assets/unityAppliction/Build/build.json', {onProgress: UnityProgress}); |
||||
this.unityInstance = UnityLoader.instantiate('unityContainer', 'assets/unityApp/Build/unityApp.json'); |
||||
// this.SendMessage('UnityWebGL', 'GetName', '');
|
||||
} |
||||
|
||||
public GetName(): void { |
||||
console.log('这是Unity调用的Angular方法'); |
||||
} |
||||
public SendMessage(objectName: string, methodName: string, value: any): void { |
||||
console.log('=============================================='); |
||||
this.unityInstance.SendMessage(objectName, methodName, value); |
||||
} |
||||
} |
||||
|
After Width: | Height: | Size: 155 B |
After Width: | Height: | Size: 137 B |
@ -0,0 +1,16 @@
|
||||
{ |
||||
"companyName": "DefaultCompany", |
||||
"productName": "2DPlanMakingTool", |
||||
"productVersion": "0.1", |
||||
"dataUrl": "unityApp.data.unityweb", |
||||
"wasmCodeUrl": "unityApp.wasm.code.unityweb", |
||||
"wasmFrameworkUrl": "unityApp.wasm.framework.unityweb", |
||||
"graphicsAPI": ["WebGL 2.0","WebGL 1.0"], |
||||
"webglContextAttributes": {"preserveDrawingBuffer": false}, |
||||
"splashScreenStyle": "Dark", |
||||
"backgroundColor": "#231F20", |
||||
"cacheControl": {"default": "must-revalidate"}, |
||||
"developmentBuild": false, |
||||
"multithreading": false, |
||||
"unityVersion": "2019.3.2f1" |
||||
} |
After Width: | Height: | Size: 1.7 MiB |
@ -0,0 +1,112 @@
|
||||
<linker> |
||||
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> |
||||
<type fullname="UnityEngine.GameObject" preserve="all" /> |
||||
<type fullname="UnityEngine.Material" preserve="all" /> |
||||
<type fullname="UnityEngine.Texture2D" preserve="all" /> |
||||
<type fullname="UnityEngine.Sprite" preserve="all" /> |
||||
<type fullname="UnityEngine.RectTransform" preserve="all" /> |
||||
<type fullname="UnityEngine.U2D.SpriteAtlas" preserve="all" /> |
||||
</assembly> |
||||
<assembly fullname="UnityEngine.Physics2DModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> |
||||
<type fullname="UnityEngine.Rigidbody2D" preserve="all" /> |
||||
<type fullname="UnityEngine.PolygonCollider2D" preserve="all" /> |
||||
<type fullname="UnityEngine.BoxCollider2D" preserve="all" /> |
||||
<type fullname="UnityEngine.CompositeCollider2D" preserve="all" /> |
||||
</assembly> |
||||
<assembly fullname="UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> |
||||
<type fullname="UnityEngine.AnimationClip" preserve="all" /> |
||||
<type fullname="UnityEngine.RuntimeAnimatorController" preserve="all" /> |
||||
<type fullname="UnityEngine.Animator" preserve="all" /> |
||||
</assembly> |
||||
<assembly fullname="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> |
||||
<type fullname="MultipleAssetIcon" preserve="all" /> |
||||
<type fullname="Config" preserve="all" /> |
||||
<type fullname="MessageInput" preserve="all" /> |
||||
<type fullname="MultipleClosedAssetIcon" preserve="all" /> |
||||
<type fullname="DisastersViewItemItem" preserve="all" /> |
||||
<type fullname="ColorBoard" preserve="all" /> |
||||
<type fullname="UIViewAddBuilding" preserve="all" /> |
||||
<type fullname="UIViewMain" preserve="all" /> |
||||
<type fullname="Point" preserve="all" /> |
||||
<type fullname="AssetInfoItem" preserve="all" /> |
||||
<type fullname="DirectionControl" preserve="all" /> |
||||
<type fullname="DragUGUI2" preserve="all" /> |
||||
<type fullname="TextBoxAsset" preserve="all" /> |
||||
<type fullname="ExpandViewItem" preserve="all" /> |
||||
<type fullname="ExpandViewOneOrTwoItem" preserve="all" /> |
||||
<type fullname="UIFloorControl" preserve="all" /> |
||||
<type fullname="AssetLibItem" preserve="all" /> |
||||
<type fullname="ExpandView" preserve="all" /> |
||||
<type fullname="FillingArea" preserve="all" /> |
||||
<type fullname="WorkingArea" preserve="all" /> |
||||
<type fullname="CanvasSampleOpenFileImage" preserve="all" /> |
||||
<type fullname="Arrows" preserve="all" /> |
||||
<type fullname="DisastersViewItem" preserve="all" /> |
||||
<type fullname="BuildingFloor" preserve="all" /> |
||||
<type fullname="SinglepointIcon" preserve="all" /> |
||||
<type fullname="ImageBrowser" preserve="all" /> |
||||
<type fullname="UIViewLoading" preserve="all" /> |
||||
<type fullname="BuildingTab" preserve="all" /> |
||||
<type fullname="UIViewMessageYesNo" preserve="all" /> |
||||
<type fullname="UIViewAddBuildingFloor" preserve="all" /> |
||||
<type fullname="XTreeView.TreeViewControl" preserve="all" /> |
||||
<type fullname="SelfAdaptionInputField" preserve="all" /> |
||||
<type fullname="Floor" preserve="all" /> |
||||
<type fullname="NewBehaviourScript" preserve="all" /> |
||||
<type fullname="AngleInputField" preserve="all" /> |
||||
<type fullname="AssetPropertiesView" preserve="all" /> |
||||
<type fullname="XTreeView.TreeViewItem" preserve="all" /> |
||||
<type fullname="SitePlanTab" preserve="all" /> |
||||
<type fullname="CustomButton" preserve="all" /> |
||||
<type fullname="SitePlanFloor" preserve="all" /> |
||||
<type fullname="InputField_WebGL" preserve="all" /> |
||||
<type fullname="MessageBox" preserve="all" /> |
||||
<type fullname="UIViewCreateBackground" preserve="all" /> |
||||
<type fullname="Line" preserve="all" /> |
||||
<type fullname="Tips" preserve="all" /> |
||||
<type fullname="SetOutline" preserve="all" /> |
||||
</assembly> |
||||
<assembly fullname="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"> |
||||
<type fullname="UnityEngine.UI.Text" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.Scrollbar" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.Image" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.GridLayoutGroup" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.ContentSizeFitter" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.LayoutElement" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.Mask" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.ScrollRect" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.Button" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.RawImage" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.VerticalLayoutGroup" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.InputField" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.HorizontalLayoutGroup" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.Outline" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.Dropdown" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.Toggle" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.Slider" preserve="all" /> |
||||
<type fullname="UnityEngine.UI.ToggleGroup" preserve="all" /> |
||||
</assembly> |
||||
<assembly fullname="UniRx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> |
||||
<type fullname="UniRx.Triggers.ObservableDestroyTrigger" preserve="all" /> |
||||
</assembly> |
||||
<assembly fullname="UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> |
||||
<type fullname="UnityEditor.MonoScript" preserve="all" /> |
||||
</assembly> |
||||
<assembly fullname="UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> |
||||
<type fullname="UnityEngine.Font" preserve="all" /> |
||||
</assembly> |
||||
<assembly fullname="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> |
||||
<type fullname="UnityEngine.CanvasRenderer" preserve="all" /> |
||||
<type fullname="UnityEngine.CanvasGroup" preserve="all" /> |
||||
</assembly> |
||||
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all"> |
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" /> |
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" /> |
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" /> |
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" /> |
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" /> |
||||
</assembly> |
||||
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all"> |
||||
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" /> |
||||
</assembly> |
||||
</linker> |
@ -0,0 +1 @@
|
||||
{"m_buildTarget":"WebGL","m_SettingsHash":"","m_CatalogLocations":[{"m_Keys":["AddressablesMainContentCatalog"],"m_InternalId":"{UnityEngine.AddressableAssets.Addressables.RuntimePath}/catalog.json","m_Provider":"UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider","m_Dependencies":[],"m_ResourceType":{"m_AssemblyName":"Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_ClassName":"UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData"}}],"m_ProfileEvents":false,"m_LogResourceManagerExceptions":true,"m_ExtraInitializationData":[],"m_DisableCatalogUpdateOnStart":false,"m_CertificateHandlerType":{"m_AssemblyName":"","m_ClassName":""}} |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 345 B |
After Width: | Height: | Size: 155 B |
After Width: | Height: | Size: 159 B |
After Width: | Height: | Size: 137 B |
After Width: | Height: | Size: 142 B |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1,18 @@
|
||||
.webgl-content * {border: 0; margin: 0; padding: 0} |
||||
.webgl-content {position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);} |
||||
|
||||
.webgl-content .logo, .progress {position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);} |
||||
.webgl-content .logo {background: url('progressLogo.Light.png') no-repeat center / contain; width: 154px; height: 130px;} |
||||
.webgl-content .progress {height: 18px; width: 141px; margin-top: 90px;} |
||||
.webgl-content .progress .empty {background: url('progressEmpty.Light.png') no-repeat right / cover; float: right; width: 100%; height: 100%; display: inline-block;} |
||||
.webgl-content .progress .full {background: url('progressFull.Light.png') no-repeat left / cover; float: left; width: 0%; height: 100%; display: inline-block;} |
||||
|
||||
.webgl-content .logo.Dark {background-image: url('progressLogo.Dark.png');} |
||||
.webgl-content .progress.Dark .empty {background-image: url('progressEmpty.Dark.png');} |
||||
.webgl-content .progress.Dark .full {background-image: url('progressFull.Dark.png');} |
||||
|
||||
.webgl-content .footer {margin-top: 5px; height: 38px; line-height: 38px; font-family: Helvetica, Verdana, Arial, sans-serif; font-size: 18px;} |
||||
.webgl-content .footer .webgl-logo, .title, .fullscreen {height: 100%; display: inline-block; background: transparent center no-repeat;} |
||||
.webgl-content .footer .webgl-logo {background-image: url('webgl-logo.png'); width: 204px; float: left;} |
||||
.webgl-content .footer .title {margin-right: 10px; float: right;} |
||||
.webgl-content .footer .fullscreen {background-image: url('fullscreen.png'); width: 38px; float: right;} |
After Width: | Height: | Size: 3.5 KiB |
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="en-us"> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
||||
<title>Unity WebGL Player | 2DPlanMakingTool</title> |
||||
<link rel="shortcut icon" href="TemplateData/favicon.ico"> |
||||
<link rel="stylesheet" href="TemplateData/style.css"> |
||||
<script src="TemplateData/UnityProgress.js"></script> |
||||
<script src="Build/UnityLoader.js"></script> |
||||
<script> |
||||
var unityInstance = UnityLoader.instantiate("unityContainer", "Build/unityApp.json", {onProgress: UnityProgress}); |
||||
</script> |
||||
</head> |
||||
<body> |
||||
<div class="webgl-content"> |
||||
<div id="unityContainer" style="width: 1024px; height: 768px"></div> |
||||
<div class="footer"> |
||||
<div class="webgl-logo"></div> |
||||
<div class="fullscreen" onclick="unityInstance.SetFullscreen(1)"></div> |
||||
<div class="title">2DPlanMakingTool</div> |
||||
</div> |
||||
</div> |
||||
</body> |
||||
</html> |