Browse Source

unity组件

develop
徐振升 5 years ago
parent
commit
6fe1658d6b
  1. 14
      angular.json
  2. 6
      src/app/app.module.ts
  3. 1
      src/app/ui/plan/plan.component.html
  4. 3
      src/app/ui/ui.module.ts
  5. 3
      src/app/ui/unity/unity.component.html
  6. 4
      src/app/ui/unity/unity.component.scss
  7. 25
      src/app/ui/unity/unity.component.spec.ts
  8. 19
      src/app/ui/unity/unity.component.ts
  9. 1
      tsconfig.json
  10. 1
      typing.d.ts

14
angular.json

@ -34,7 +34,9 @@
],
"scripts": [
"node_modules/echarts/dist/echarts.js",
"./node_modules/swiper/js/swiper.min.js"
"./node_modules/swiper/js/swiper.min.js",
"src/assets/unityAppliction/Build/UnityLoader.js",
"src/assets/unityAppliction/TemplateData/UnityProgress.js"
]
},
"configurations": {
@ -72,7 +74,7 @@
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "anxin119:build",
"proxyConfig": "proxy.config.json"
"proxyConfig": "proxy.config.json"
},
"configurations": {
"production": {
@ -129,6 +131,10 @@
}
}
}
}},
"defaultProject": "anxin119"
}
},
"defaultProject": "anxin119",
"cli": {
"analytics": false
}
}

6
src/app/app.module.ts

@ -14,9 +14,9 @@ import { PagesModule } from './pages/pages.module';
import { FormsModule } from '@angular/forms';
import { UiModule } from './ui/ui.module';
import { HttpClientModule } from '@angular/common/http';
import { httpInterceptorProviders } from './http-interceptors/index'
import {CacheTokenService} from './http-interceptors/cache-token.service'
import { TreeService } from'./http-interceptors/tree.service'
import { httpInterceptorProviders } from './http-interceptors/index';
import {CacheTokenService} from './http-interceptors/cache-token.service';
import { TreeService } from './http-interceptors/tree.service';
@NgModule({
declarations: [

1
src/app/ui/plan/plan.component.html

@ -0,0 +1 @@
<app-unity></app-unity>

3
src/app/ui/ui.module.ts

@ -94,9 +94,10 @@ import { ImagesData } from './fire-fighting-device/imagesdata.component';
import { ImgsDataDetail } from './fire-fighting-device/imgsdatadetail.component';
import { KeySiteImgs } from './key-site/keysiteimgs.component';
import { KeyImgDetail } from './key-site/keyimgdetail.component';
import { UnityComponent} from './unity/unity.component';
@NgModule({
declarations: [UiComponent, CardComponent, StepperComponent, TabgroupComponent, ProgressComponent, SnackbarComponent,PersonaldataComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,EditRole,TimePipe,CreateNewUser,EditNewUser,allRoles,SharePower,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, BasicinfoComponent, PlanComponent, AllaroundComponent, FireFightingDeviceComponent, KeySiteComponent, FunctionDivisionComponent, RealisticPictureComponent, UploadingCADComponent,AddHouseInfo,ImgDetails,ImagesData,ImgsDataDetail,KeySiteImgs,KeyImgDetail,addPartition,addPartitionAttribute,previewImg,addRealPicture,editRealPicture
declarations: [UiComponent, CardComponent, StepperComponent, TabgroupComponent, ProgressComponent, SnackbarComponent,PersonaldataComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,EditRole,TimePipe,CreateNewUser,EditNewUser,allRoles,SharePower,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, BasicinfoComponent, PlanComponent, AllaroundComponent, FireFightingDeviceComponent, KeySiteComponent, FunctionDivisionComponent, RealisticPictureComponent, UploadingCADComponent,AddHouseInfo,ImgDetails,ImagesData,ImgsDataDetail,KeySiteImgs,KeyImgDetail,addPartition,addPartitionAttribute,previewImg,addRealPicture,editRealPicture,UnityComponent
],
imports: [

3
src/app/ui/unity/unity.component.html

@ -0,0 +1,3 @@
<div class="webgl-content">
<div id="unityContainer"></div>
</div>

4
src/app/ui/unity/unity.component.scss

@ -0,0 +1,4 @@
#unityContainer{
width: 100%;
height: 100%;
}

25
src/app/ui/unity/unity.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { UnityComponent } from './unity.component';
describe('UnityComponent', () => {
let component: UnityComponent;
let fixture: ComponentFixture<UnityComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UnityComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(UnityComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

19
src/app/ui/unity/unity.component.ts

@ -0,0 +1,19 @@
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() { }
ngOnInit(): void {
UnityLoader.instantiate('unityContainer', 'assets/unityAppliction/Build/build.json', {onProgress: UnityProgress});
}
}

1
tsconfig.json

@ -1,6 +1,7 @@
{
"compileOnSave": false,
"compilerOptions": {
"allowJs": true,
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,

1
typing.d.ts vendored

@ -0,0 +1 @@
declare var UnityLoader : any;
Loading…
Cancel
Save