public void Initialize(LaserBeamAssault lba, float laserSpeed, LaserDirection dir, LaserPosition pos, float lifespan, float topRotation, float bottomRotation) { destructionTimer = lifespan; assault = lba; speed = laserSpeed; laserDirection = dir; laserPosition = pos; topLaserInitialRotation = topRotation; bottomLaserInitialRotation = bottomRotation; if (dir == LaserDirection.RIGHT) { if (laserPosition == LaserPosition.TOP) { this.transform.rotation = Quaternion.Euler(0, 0, topLaserInitialRotation); } else { this.transform.rotation = Quaternion.Euler(0, 0, bottomLaserInitialRotation); } } else { if (laserPosition == LaserPosition.TOP) { this.transform.rotation = Quaternion.Euler(0, 0, -topLaserInitialRotation); } else { this.transform.rotation = Quaternion.Euler(0, 0, -bottomLaserInitialRotation); } } }
protected override void PowerupFunctionality() { switch (tType) { case PowerupManager.TriggerTypes.LASER_BEAM_ASSAULT: LaserBeamAssault laserAssault = this.gameObject.AddComponent <LaserBeamAssault>(); laserAssault.SetUpLaserAssault(playerWhoEarnedPowerup, powerupManager.laserSpeed, powerupManager.lbaRotationTime, powerupManager.lbaTopInitialRotation, powerupManager.lbaBottomInitialRotation); laserAssault.GetLaserSpawnPoints(powerupManager.p1LaserSpawns, powerupManager.p2LaserSpawns); laserAssault.SpawnLasers(); break; case PowerupManager.TriggerTypes.METEOR_SHOWER: if (playerWhoEarnedPowerup == Player.PlayerIdentity.PLAYER_1) { powerupManager.p2Strike.StartMeteorStrike(); } else { powerupManager.p1Strike.StartMeteorStrike(); } break; } }