public void GetPlayerBackOnRightSpot() { if (IntersceneManager.intersceneManager != null) { ArenaParameters parameters = IntersceneManager.intersceneManager.ArenaInterscInformations.GetLaunchedArenaParameters; if (parameters != null) { MapArenaSpot arenaSpot = null; foreach (MapArenaSpot spot in mapProgressionManager.GetAllMapArenaSpots) { if (spot.GetArenaParameters == parameters) { arenaSpot = spot; arenaSpot.SetDontActivateSincePlayerOut(); break; } } ShipMovements playerShipMvt = playerShip.ShipMvt; if (arenaSpot != null) { if (arenaSpot.GetPlayerTransformOnceStopped != null) { playerShip.transform.position = arenaSpot.GetPlayerTransformOnceStopped.position; playerShipMvt.SetCurrentRotation(arenaSpot.GetPlayerTransformOnceStopped.rotation.eulerAngles.y); } } } } }
public override bool UseCompetence(ShipMovements relatedShip) { if (relatedShip.GetCurrentRammingParameters.IsAttacking) { return(false); } relatedShip.StartRamming(rammingParameters); return(true); }
public void StartCameraMove(bool stopPlayer) { ShipMovements playerMovements = GameManager.gameManager.Player.ShipMvt; if (!playerMovements.Stopped && stopPlayer) { playerMovements.StopShip(); stoppedPlayer = true; } else if (playerMovements.Stopped && !stopPlayer) { Debug.Log("ui"); playerMovements.StartShip(); stoppedPlayer = false; } playerInterface.HidePlayerInterface(); }
public void EndCinematic() { if (OnCinematicEnd != null) { OnCinematicEnd(); OnCinematicEnd = null; } currentCinematicParameters = default; firstCinematicCam = null; lastCinematicCam = null; currentCinematicPartIndex = 0; currentIntroControler.SetCinematicEnded(); currentIntroControler = null; skipCinematicButton.gameObject.SetActive(false); cinematicProcessing = false; if (currentMessageToType != null) { EndDialogue(); } if (waitingToGetControlBackToPlayer) { waitingToGetControlBackToPlayer = false; ShipMovements playerMovements = GameManager.gameManager.Player.ShipMvt; if (stoppedPlayer) { playerMovements.StartShip(); stoppedPlayer = false; } playerInterface.ShowPlayerInterface(); } }
public void spawnNewPlayer() { Transform spawn = respawns[Random.Range(0, this.respawns.Length)].transform; this.movingLeft = false; this.movingRight = false; this.movingFront = false; this.movingBack = false; this.barrelLeft = false; this.barrelRight = false; this.ship = Network.Instantiate(shipPrefab, spawn.position, spawn.rotation, 0) as GameObject; //this.ship.rigidbody.interpolation = RigidbodyInterpolation.Interpolate; // use this if add velocity in Update and not in Fixed update this.camScript.setTarget(this.ship.transform); this.camScriptCrossHair.setTarget(this.ship.transform); this.shipMovementsScript = ship.GetComponent <ShipMovements>(); this.shipWeaponsScript = ship.GetComponent <ShipWeapons>(); this.shipCrosshairScript = ship.GetComponent <ShipCrosshair>(); this.camScript.resetZoom(); this.camScriptCrossHair.resetZoom(); this.scriptUI.setScriptLife(ship.GetComponent <shipLife>()); this.scriptUI.setScriptWeapons(ship.GetComponent <ShipWeapons>()); this.scriptUI.setScriptMovements(this.shipMovementsScript); }
public void EndCameraMoves() { comingBackToPlayer = false; if (currentCinematicAllParts[currentCinematicPartIndex].cam == null) { if (!currentCinematicAllParts[currentCinematicPartIndex].GetDontGivePlayerControlBack) { ShipMovements playerMovements = GameManager.gameManager.Player.ShipMvt; if (stoppedPlayer) { playerMovements.StartShip(); stoppedPlayer = false; } playerInterface.ShowPlayerInterface(); } else { waitingToGetControlBackToPlayer = true; } } else { ShipMovements playerMovements = GameManager.gameManager.Player.ShipMvt; if (stoppedPlayer) { playerMovements.StartShip(); stoppedPlayer = false; } playerInterface.ShowPlayerInterface(); } }
/// <summary> /// Initialisation de la barre du bateau /// </summary> /// <param name="movements"></param> public void SetUp(ShipMovements movements) { playerShipMovements = movements; }
public void StartCinematicPart() { CinematicPart startedPart = currentCinematicAllParts[currentCinematicPartIndex]; /*ShipMovements playerMovements = GameManager.gameManager.Player.ShipMvt; * if (startedPart.GetMovePlayerBoatWhileCinematic && playerMovements.Stopped)*/ if (startedPart.StartSpawnedEnemies && shipsToStartOnSpecificPart != null) { foreach (EnemyShip enemy in shipsToStartOnSpecificPart) { enemy.ShipMvt.StartShip(); } shipsToStartOnSpecificPart = new List <EnemyShip>(); } remainingCinematicPartDuration = startedPart.GetWaitTimeOnceEnded; if (remainingCinematicPartDuration == 0) { remainingCinematicPartDuration = 1.5f; } #region Cameras if (startedPart.cam != null) { if (startedPart.cam == firstCinematicCam) { StartCameraMove(!startedPart.GetMovePlayerBoatWhileCinematic); } startedPart.cam.gameObject.SetActive(true); cinematicPartHasCamMove = true; skipCinematicButton.gameObject.SetActive(true); } else { if (GameManager.gameManager.StartedFight) { cinematicPartHasCamMove = false; skipCinematicButton.gameObject.SetActive(false); } else { /*if (startedPart.cam == firstCinematicCam) * StartCameraMove(!startedPart.GetMovePlayerBoatWhileCinematic);*/ //startedPart.cam.gameObject.SetActive(true); cinematicPartHasCamMove = true; skipCinematicButton.gameObject.SetActive(true); } } #endregion #region Dialogue CreateAText messageToType = currentCinematicAllParts[currentCinematicPartIndex].messageToType; if (messageToType != null && messageToType != currentMessageToType) { StartDialogue(messageToType); } else if (messageToType == null && messageToType != currentMessageToType) { EndDialogue(); } #endregion #region Animators if (startedPart.GetAnimatorsToLaunchOnPartBeginning != null) { foreach (Animator animatorToLaunch in startedPart.GetAnimatorsToLaunchOnPartBeginning) { if (animatorToLaunch != null) { animatorToLaunch.SetTrigger("Cinematic"); } } } #endregion if (waitingToGetControlBackToPlayer && !startedPart.GetDontGivePlayerControlBack) { waitingToGetControlBackToPlayer = false; ShipMovements playerMovements = GameManager.gameManager.Player.ShipMvt; if (stoppedPlayer) { playerMovements.StartShip(); stoppedPlayer = false; } playerInterface.ShowPlayerInterface(); } startedPart.PlayStartEvent(); }
public void setScriptMovements(ShipMovements script) { this.shipMovementsScript = script; }