mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-10-09 16:46:00 +00:00
Screen fader
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Camera, Component, KeyCode, Prefab, Vec2, _decorator } from "cc";
|
||||
import { ModalWindowManager } from "../Services/ModalWindowSystem/ModalWindowManager";
|
||||
import { delay } from "../Services/Utils/AsyncUtils";
|
||||
import { OpenCloseAnimator } from "../Utils/OpenCloseAnimator";
|
||||
import { GameAudioAdapter } from "./Audio/GameAudioAdapter";
|
||||
import { Background } from "./Background/Background";
|
||||
import { MagnetCollisionSystem } from "./Collision/MagnetCollisionSystem";
|
||||
@@ -50,6 +51,7 @@ export class Game extends Component {
|
||||
@property(Background) private background: Background;
|
||||
@property(ModalWindowManager) private modalWindowManager: ModalWindowManager;
|
||||
@property(GameAudioAdapter) private gameAudioAdapter: GameAudioAdapter;
|
||||
@property(OpenCloseAnimator) private screenFader: OpenCloseAnimator;
|
||||
|
||||
private playerCollisionSystem: PlayerCollisionSystem;
|
||||
private haloProjectileLauncher: HaloProjectileLauncher;
|
||||
@@ -73,6 +75,9 @@ export class Game extends Component {
|
||||
public start(): void {
|
||||
Game.instance = this;
|
||||
this.gamePauser.pause();
|
||||
|
||||
this.screenFader.init();
|
||||
this.screenFader.node.active = true;
|
||||
}
|
||||
|
||||
public async playGame(
|
||||
@@ -169,6 +174,7 @@ export class Game extends Component {
|
||||
this.haloProjectileLauncher
|
||||
);
|
||||
this.gamePauser.resume();
|
||||
this.screenFader.playClose();
|
||||
|
||||
while (!this.gameResult.hasExitManually && this.player.Health.IsAlive) await delay(100);
|
||||
if (!this.gameResult.hasExitManually) {
|
||||
|
@@ -42,8 +42,6 @@ export class ProjectileLauncher extends Component implements IProjectileLauncher
|
||||
this.projectilePierces = projectilePierces;
|
||||
|
||||
this.projectilePool = new ObjectPool<Projectile>(this.projectilePrefab, this.node, 6, "Projectile");
|
||||
|
||||
console.log("DAMAGE " + JSON.stringify((<Projectile>this.projectilePrefab.data).Damage));
|
||||
}
|
||||
|
||||
public gameTick(deltaTime: number): void {
|
||||
|
Reference in New Issue
Block a user