-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
94 additions
and
94 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
// | ||
// index.ts | ||
// | ||
// Created by Nolan Huang on 24 Aug 2022. | ||
// Copyright 2022 Vircadia contributors. | ||
// Copyright 2022 DigiSomni LLC. | ||
// | ||
// Distributed under the Apache License, Version 2.0. | ||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | ||
// | ||
|
||
export { KeyLightComponent } from "./KeyLight"; | ||
export { HazeComponent } from "./haze"; | ||
export { SkyboxComponent } from "./skybox"; | ||
export { ModelComponent } from "./model"; | ||
export { ImageComponent } from "./image"; | ||
export { MaterialComponent } from "./materialComponent"; | ||
export { ShapeComponent } from "./shapeComponent"; | ||
export { LightEntityComponent } from "./lightComponent"; | ||
// | ||
// index.ts | ||
// | ||
// Created by Nolan Huang on 24 Aug 2022. | ||
// Copyright 2022 Vircadia contributors. | ||
// Copyright 2022 DigiSomni LLC. | ||
// | ||
// Distributed under the Apache License, Version 2.0. | ||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | ||
// | ||
|
||
export { KeyLightComponent } from "./KeyLightComponent"; | ||
export { HazeComponent } from "./HazeComponent"; | ||
export { SkyboxComponent } from "./SkyboxComponent"; | ||
export { ModelComponent } from "./ModelComponent"; | ||
export { ImageComponent } from "./ImageComponent"; | ||
export { MaterialComponent } from "./MaterialComponent"; | ||
export { ShapeComponent } from "./ShapeComponent"; | ||
export { LightEntityComponent } from "./LightComponent"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
// | ||
// index.ts | ||
// | ||
// Created by Nolan Huang on 4 Aug 2022. | ||
// Copyright 2022 Vircadia contributors. | ||
// Copyright 2022 DigiSomni LLC. | ||
// | ||
// Distributed under the Apache License, Version 2.0. | ||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | ||
// | ||
|
||
export { EntityController } from "./EntityController"; | ||
export { ShapeEntityController } from "./ShapeEntityController"; | ||
export { ModelEntityController } from "./ModelEntityController"; | ||
export { LightEntityController } from "./LightEntityController"; | ||
export { ZoneEntityController } from "./ZoneEntityController"; | ||
export { ImageEntityController } from "./ImageEntityController"; | ||
export { MaterialEntityController } from "./materialEntityController"; | ||
export { WebEntityController } from "./webEntityController"; | ||
// | ||
// index.ts | ||
// | ||
// Created by Nolan Huang on 4 Aug 2022. | ||
// Copyright 2022 Vircadia contributors. | ||
// Copyright 2022 DigiSomni LLC. | ||
// | ||
// Distributed under the Apache License, Version 2.0. | ||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | ||
// | ||
|
||
export { EntityController } from "./EntityController"; | ||
export { ShapeEntityController } from "./ShapeEntityController"; | ||
export { ModelEntityController } from "./ModelEntityController"; | ||
export { LightEntityController } from "./LightEntityController"; | ||
export { ZoneEntityController } from "./ZoneEntityController"; | ||
export { ImageEntityController } from "./ImageEntityController"; | ||
export { MaterialEntityController } from "./MaterialEntityController"; | ||
export { WebEntityController } from "./WebEntityController"; |
112 changes: 56 additions & 56 deletions
112
src/modules/entity/components/controllers/materialEntityController.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
// | ||
// materialEntityController.ts | ||
// | ||
// Created by Nolan Huang on 19 Sep 2022. | ||
// Copyright 2022 Vircadia contributors. | ||
// Copyright 2022 DigiSomni LLC. | ||
// | ||
// Distributed under the Apache License, Version 2.0. | ||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | ||
// | ||
|
||
// Domain Modules | ||
import { EntityController } from "./EntityController"; | ||
import { IMaterialEntity } from "../../EntityInterfaces"; | ||
import { MaterialComponent } from "../../components"; | ||
|
||
export class MaterialEntityController extends EntityController { | ||
// domain properties | ||
_materialEntity: IMaterialEntity; | ||
_materialComponent: Nullable<MaterialComponent>; | ||
|
||
constructor(entity: IMaterialEntity) { | ||
super(entity, MaterialEntityController.typeName); | ||
this._materialEntity = entity; | ||
} | ||
|
||
static get typeName(): string { | ||
return "MaterialEntityController"; | ||
} | ||
|
||
/** | ||
* Gets a string identifying the type of this Component | ||
* @returns "MaterialEntityController" string | ||
*/ | ||
// eslint-disable-next-line class-methods-use-this | ||
public get componentType(): string { | ||
return MaterialEntityController.typeName; | ||
} | ||
|
||
public onInitialize(): void { | ||
super.onInitialize(); | ||
|
||
this._materialComponent = new MaterialComponent(); | ||
this._gameObject?.addComponent(this._materialComponent); | ||
} | ||
|
||
public onStart(): void { | ||
super.onStart(); | ||
this._materialComponent?.load(this._materialEntity); | ||
} | ||
|
||
protected _updateParent(): void { | ||
this._materialComponent?.updateParent(this._materialEntity); | ||
super._updateParent(); | ||
} | ||
} | ||
// | ||
// materialEntityController.ts | ||
// | ||
// Created by Nolan Huang on 19 Sep 2022. | ||
// Copyright 2022 Vircadia contributors. | ||
// Copyright 2022 DigiSomni LLC. | ||
// | ||
// Distributed under the Apache License, Version 2.0. | ||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | ||
// | ||
|
||
// Domain Modules | ||
import { EntityController } from "./EntityController"; | ||
import { IMaterialEntity } from "../../EntityInterfaces"; | ||
import { MaterialComponent } from ".."; | ||
|
||
export class MaterialEntityController extends EntityController { | ||
// domain properties | ||
_materialEntity: IMaterialEntity; | ||
_materialComponent: Nullable<MaterialComponent>; | ||
|
||
constructor(entity: IMaterialEntity) { | ||
super(entity, MaterialEntityController.typeName); | ||
this._materialEntity = entity; | ||
} | ||
|
||
static get typeName(): string { | ||
return "MaterialEntityController"; | ||
} | ||
|
||
/** | ||
* Gets a string identifying the type of this Component | ||
* @returns "MaterialEntityController" string | ||
*/ | ||
// eslint-disable-next-line class-methods-use-this | ||
public get componentType(): string { | ||
return MaterialEntityController.typeName; | ||
} | ||
|
||
public onInitialize(): void { | ||
super.onInitialize(); | ||
|
||
this._materialComponent = new MaterialComponent(); | ||
this._gameObject?.addComponent(this._materialComponent); | ||
} | ||
|
||
public onStart(): void { | ||
super.onStart(); | ||
this._materialComponent?.load(this._materialEntity); | ||
} | ||
|
||
protected _updateParent(): void { | ||
this._materialComponent?.updateParent(this._materialEntity); | ||
super._updateParent(); | ||
} | ||
} |