Esempio n. 1
0
        static void OnChangePlayMode(PlayModeStateChange playMode)
        {
            switch (playMode)
            {
            case PlayModeStateChange.ExitingPlayMode:
                PreviewControlWindow.SetIsInGameMode(false);
                break;

            case PlayModeStateChange.EnteredPlayMode:
                PreviewControlWindow.SetIsInGameMode(true);
                var commentScreenViews = new List <ICommentScreenView>();
                var mainScreenViews    = new List <IMainScreenView>();
                var rankingScreenViews = new List <IRankingScreenView>();

                foreach (var binding in Resources.FindObjectsOfTypeAll <SdkBindingBase>()
                         .Where(x => x.gameObject.scene.isLoaded))
                {
                    if (binding is ICommentScreenView commentScreenView)
                    {
                        commentScreenViews.Add(commentScreenView);
                    }
                    if (binding is IRankingScreenView rankingScreenView)
                    {
                        rankingScreenViews.Add(rankingScreenView);
                    }
                    if (binding is IMainScreenView mainScreenView)
                    {
                        mainScreenViews.Add(mainScreenView);
                    }
                }

                venueGimmickManager = new VenueGimmickManager();

                foreach (var venueGimmick in Resources.FindObjectsOfTypeAll <VenueGimmickBase>()
                         .Where(x => x.gameObject.scene.isLoaded))
                {
                    venueGimmick.Initialize(venueGimmickManager);
                }
                rankingScreenPresenter = new RankingScreenPresenter(rankingScreenViews);
                commentScreenPresenter = new CommentScreenPresenter(commentScreenViews);
                mainScreenPresenter    = new MainScreenPresenter(mainScreenViews);

                rankingScreenPresenter.SetRanking(10);
                break;
            }
        }
Esempio n. 2
0
        static void OnChangePlayMode(PlayModeStateChange playMode)
        {
            switch (playMode)
            {
            case PlayModeStateChange.ExitingPlayMode:
                SetIsInGameMode(false);
                break;

            case PlayModeStateChange.EnteredPlayMode:
                SetIsInGameMode(true);

                var commentScreenViews = new List <ICommentScreenView>();
                var mainScreenViews    = new List <IMainScreenView>();
                var rankingScreenViews = new List <IRankingScreenView>();
                var spawnPoints        = new List <ISpawnPoint>();
                var despawnHeight      = float.MinValue;
                var triggerSenders     = new List <ITriggerSender>();

                foreach (var binding in Resources.FindObjectsOfTypeAll <SdkBindingBase>()
                         .Where(x => x.gameObject.scene.isLoaded))
                {
                    switch (binding)
                    {
                    case ICommentScreenView commentScreenView:
                        commentScreenViews.Add(commentScreenView);
                        break;

                    case IRankingScreenView rankingScreenView:
                        rankingScreenViews.Add(rankingScreenView);
                        break;

                    case IMainScreenView mainScreenView:
                        mainScreenViews.Add(mainScreenView);
                        break;

                    case ISpawnPoint spawnPoint:
                        spawnPoints.Add(spawnPoint);
                        break;

                    case IWarpPortal warpPortal:
                        warpPortal.OnEnterWarpPortalEvent += (sender, e) =>
                        {
                            if (!e.KeepPosition)
                            {
                                playerPresenter.PlayerTransform.position = e.ToPosition;
                            }

                            if (!e.KeepRotation)
                            {
                                playerPresenter.CameraTransform.rotation = e.ToRotation;
                            }
                        };
                        break;

                    case IDespawnHeight _despawnHeight:
                        despawnHeight = _despawnHeight.Height;
                        break;

                    case ITriggerSender triggerSender:
                        triggerSender.TriggerEvent += (sender, args) =>
                                                      venueGimmickManager.RunFromTriggerSender(args.Id, 0,
                                                                                               playerPresenter.PermissionType);
                        break;
                    }
                }


                venueGimmickManager = new VenueGimmickManager();

                foreach (var venueGimmick in Resources.FindObjectsOfTypeAll <VenueGimmickBase>()
                         .Where(x => x.gameObject.scene.isLoaded))
                {
                    venueGimmick.Initialize(venueGimmickManager);
                }

                rankingScreenPresenter = new RankingScreenPresenter(rankingScreenViews);
                commentScreenPresenter = new CommentScreenPresenter(commentScreenViews);
                mainScreenPresenter    = new MainScreenPresenter(mainScreenViews);
                spawnPointManager      = new SpawnPointManager(spawnPoints);
                //疑似Playerの設定
                var enterDeviceType = EnterDeviceType.Desktop;
                if (XRSettings.enabled)
                {
                    enterDeviceType = EnterDeviceType.VR;
                }

                playerPresenter = new PlayerPresenter(PermissionType.Audience, enterDeviceType);
                avatarRespawner = new AvatarRespawner(despawnHeight, playerPresenter);

                rankingScreenPresenter.SetRanking(11);
                var GimmickIdList = venueGimmickManager.GimmickDataList.Select(x => x.Id).ToList();
                if (GimmickIdList.Count != 0)
                {
                    OnUpdateTriggerIdList?.Invoke(GimmickIdList);
                }
                break;
            }
        }