Пример #1
0
    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);
                    }
                }
            }
        }
    }
Пример #2
0
    public void OpenArenaPanel(CinemachineVirtualCamera virtualCamera, MapArenaSpot arenaSpot)
    {
        virtualCamera.gameObject.SetActive(true);

        mapManager.SetLastActivatedVirtualCamera(virtualCamera);
        mapManager.SetOpenedSpecialPlace(arenaSpot);

        mapManager.SetPlayerNotPlayable();

        arenaInterface.OpenArenaPanel(arenaSpot.GetArenaParameters.GetDisplayName, arenaSpot.GetArenaParameters.GetDisplayDescription, arenaSpot.GetStarsNumber, arenaSpot.GetArenaParameters.GetArenaMode);

        mapManager.ShipCompoManager.OpenEquipedEquipmentPanel();
    }
Пример #3
0
    public void StartLaunchArena()
    {
        if (loadingArena)
        {
            return;
        }

        mapManager.SavePlayerDatas();

        MapArenaSpot arenaSpot = mapManager.GetOpenedSpecialPlace as MapArenaSpot;

        if (arenaSpot == null)
        {
            return;
        }

        EquipmentsSet equipmentsSet = mapManager.ShipCompoManager.ComposeEquipmentSet();

        if (equipmentsSet.GetHullEquipment == null)
        {
            Debug.LogWarning("Attention : il n'y a aucune coque sur ce bateau. Impossible de lancer le jeu.");
            return;
        }
        else
        {
            IntersceneManager.intersceneManager.SetPlayerDatas(equipmentsSet);
        }

        ArenaParameters launchedArenaParameters = arenaSpot.GetArenaParameters;
        string          arenaBuildName          = launchedArenaParameters.GetSceneToLoadName;

        try
        {
            IntersceneManager.intersceneManager.MapInterscInformations.SetMapIntersceneInfos(SceneManager.GetActiveScene().name, GameManager.gameManager.Player.transform.position, launchedArenaParameters.GetSpecialSceneToLoadAfterSuccesName);
            IntersceneManager.intersceneManager.ArenaInterscInformations.SetArenaLaunchInformations(launchedArenaParameters);

            //SceneManager.LoadSceneAsync(arenaBuildName);
            sceneToLoad  = arenaBuildName;
            loadingArena = true;
            GameManager.gameManager.LoadScreenManager.StartEndLoad(LaunchArena);
        }
        catch
        {
            Debug.LogWarning("Cette scene n'existe pas ou n'as pas été ajoutée à la liste des scenes buildées");
        }
    }