徐振升
5 years ago
10 changed files with 69 additions and 8 deletions
@ -0,0 +1,3 @@
|
||||
<div class="webgl-content"> |
||||
<div id="unityContainer"></div> |
||||
</div> |
@ -0,0 +1,4 @@
|
||||
#unityContainer{ |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
@ -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(); |
||||
}); |
||||
}); |
@ -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}); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue