private void startScreen()
 {
     if (Service.Get <ApplicationService>().RequiresUpdate)
     {
         ForcedUpgrade.OpenForcedUpgradePrompt();
         Service.Get <LoadingController>().RemoveLoadingSystem(this);
         return;
     }
     if (PlatformUtils.GetPlatformType() == PlatformType.Standalone && Service.Get <ApplicationService>().UpdateAvailable)
     {
         CPDataEntityCollection     cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
         DataEntityHandle           entityByType           = cPDataEntityCollection.GetEntityByType <UpgradeAvailablePromptData>();
         UpgradeAvailablePromptData component = cPDataEntityCollection.GetComponent <UpgradeAvailablePromptData>(entityByType);
         if (!component.HasSeenUpgradeAvailablePrompt)
         {
             component.HasSeenUpgradeAvailablePrompt = true;
             ForcedUpgrade.OpenOptionalUpgradePrompt();
         }
     }
     Service.Get <EventDispatcher>().AddListener <SessionEvents.SessionEndedEvent>(onSessionEnded);
     if (!Service.Get <SessionManager>().HasSession)
     {
         firstTimeSetup();
     }
     else
     {
         setupScreen();
     }
     Service.Get <LoadingController>().RemoveLoadingSystem(this);
 }
Beispiel #2
0
        private void OnDestroy()
        {
            DataEntityHandle entityByType = dataEntityCollection.GetEntityByType <PlayerCardData>();
            PlayerCardData   component    = dataEntityCollection.GetComponent <PlayerCardData>(entityByType);

            component.IsPlayerCardShowing = false;
            if (eventChannel != null)
            {
                eventChannel.RemoveAllListeners();
            }
            if (dataEntityCollection != null)
            {
                dataEntityCollection.EventDispatcher.RemoveListener <DataEntityEvents.ComponentAddedEvent <PresenceData> >(onPresenceDataAdded);
                dataEntityCollection.EventDispatcher.RemoveListener <DataEntityEvents.ComponentAddedEvent <ProfileData> >(onProfileDataAdded);
                dataEntityCollection.EventDispatcher.RemoveListener <DataEntityEvents.ComponentAddedEvent <MembershipData> >(onMembershipDataAdded);
                dataEntityCollection.EventDispatcher.RemoveListener <DataEntityEvents.ComponentAddedEvent <AvatarDetailsData> >(onAvatarDetailsDataAdded);
            }
            if (coinsData != null)
            {
                coinsData.OnCoinsChanged -= setCoins;
            }
            if (presenceData != null)
            {
                presenceData.PresenceDataUpdated -= onPresenceDataUpdated;
            }
            if (profileData != null)
            {
                profileData.ProfileDataUpdated -= onProfileDataUpdated;
            }
            if (membershipData != null)
            {
                membershipData.MembershipDataUpdated -= onMembershipDataUpdated;
            }
            this.OnHandleSet = null;
        }
        public void Awake()
        {
            pathToButtonIndexMap          = new Dictionary <string, int>();
            overrideDefinitions           = new Dictionary <int, InputButtonDefinition>();
            pendingInputButtonDefinitions = new Dictionary <int, InputButtonDefinition>();
            pendingButtonStateOverrides   = new Dictionary <int, TrayInputButton.ButtonState>();
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle       entityByType           = cPDataEntityCollection.GetEntityByType <ControlsScreenData>();

            controlsScreenData = cPDataEntityCollection.GetComponent <ControlsScreenData>(entityByType);
            controlsScreenData.IsControlsScreenActive = true;
            if (controlsScreenData.LeftOptionContentKey != null)
            {
                setLeftOption(controlsScreenData.LeftOptionContentKey);
            }
            else
            {
                setUpLeftOptionPrefab(controlsScreenData.DefaultLeftOptionPrefab);
            }
            if (controlsScreenData.ButtonGroupContentKey != null)
            {
                setRightOption(controlsScreenData.ButtonGroupContentKey);
            }
            else
            {
                setRightOption(InputButtonsContentKey);
            }
            controlsScreenData.OnSetLeftOption              += onSetLeftOption;
            controlsScreenData.OnReturnToDefaultLeftOption  += onReturnToDefaultLeftOption;
            controlsScreenData.OnSetRightOption             += onSetRightOption;
            controlsScreenData.OnReturnToDefaultRightOption += onReturnToDefaultRightOption;
            CoroutineRunner.Start(loadOverrides(), this, "loadOverrides");
        }
Beispiel #4
0
        public OpenPlayerCardCommand(DataEntityHandle handle)
        {
            this.handle          = handle;
            dataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle entityByType = dataEntityCollection.GetEntityByType <PlayerCardData>();

            playerCardDataData = dataEntityCollection.GetComponent <PlayerCardData>(entityByType);
        }
        public void Awake()
        {
            buttonClickListener = GetComponent <ButtonClickListener>();
            Transform transform = GetComponentInParent <MainNavStateHandler>().transform;

            mainNavButtons = transform.GetComponentsInChildren <MainNavButton>(includeInactive: true);
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle       entityByType           = cPDataEntityCollection.GetEntityByType <MainNavData>();

            mainNavData = cPDataEntityCollection.GetComponent <MainNavData>(entityByType);
            mainNavData.OnCurrentStateChanged += onCurrentStateChanged;
        }
Beispiel #6
0
        private static ActiveQuestData getSessionPersistentContainer()
        {
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle       dataEntityHandle       = cPDataEntityCollection.GetEntityByType <ActiveQuestData>();

            if (dataEntityHandle.IsNull)
            {
                dataEntityHandle = cPDataEntityCollection.AddEntity("ActiveQuestData");
                cPDataEntityCollection.AddComponent <ActiveQuestData>(dataEntityHandle);
            }
            return(cPDataEntityCollection.GetComponent <ActiveQuestData>(dataEntityHandle));
        }
Beispiel #7
0
    public void Awake()
    {
        TitleParent.SetActive(value: true);
        CloseButtonParent.SetActive(value: true);
        CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
        DataEntityHandle       entityByType           = cPDataEntityCollection.GetEntityByType <MainNavData>();

        mainNavData   = cPDataEntityCollection.GetComponent <MainNavData>(entityByType);
        layoutElement = GetComponent <LayoutElement>();
        if (layoutElement != null)
        {
            defaultLayoutElementHeight = layoutElement.preferredHeight;
        }
    }
Beispiel #8
0
        private bool shouldPreventPhoneFromOpening()
        {
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle       entityByType           = cPDataEntityCollection.GetEntityByType <AllAccessCelebrationData>();

            if (!entityByType.IsNull)
            {
                AllAccessCelebrationData component = cPDataEntityCollection.GetComponent <AllAccessCelebrationData>(entityByType);
                if (component.ShowAllAccessCelebration)
                {
                    return(true);
                }
            }
            return(false);
        }
        private void Start()
        {
            interactInWorldIconController = GetComponent <InteractInWorldIconController>();
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle       entityByType           = cPDataEntityCollection.GetEntityByType <ControlsScreenData>();

            controlsScreenData = cPDataEntityCollection.GetComponent <ControlsScreenData>(entityByType);
            interactInWorldIconController.SetEnabled(controlsScreenData.IsControlsScreenActive);
            controlsScreenData.OnControlsScreenActiveChanged += onControlsScreenActiveChanged;
            eventChannel = new EventChannel(Service.Get <EventDispatcher>());
            eventChannel.AddListener <ActionSequencerEvents.ActionSequenceStarted>(onActionSequenceStarted);
            eventChannel.AddListener <ActionSequencerEvents.ActionSequenceCompleted>(onActionSequenceCompleted);
            eventChannel.AddListener <TubeRaceEvents.LocalPlayerJoinedLobby>(onRaceLobbyEntered);
            eventChannel.AddListener <TubeRaceEvents.LocalPlayerLeftLobby>(onRaceLobbyLeft);
            eventChannel.AddListener <RaceGameEvents.Start>(onRaceGameStart);
            eventChannel.AddListener <RaceGameEvents.RaceFinished>(onRaceFinished);
        }
Beispiel #10
0
        private void Start()
        {
            gameStateController = Service.Get <GameStateController>();
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle       entityByType           = cPDataEntityCollection.GetEntityByType <AllAccessCelebrationData>();

            if (!entityByType.IsNull)
            {
                allAccessCelebrationData = cPDataEntityCollection.GetComponent <AllAccessCelebrationData>(entityByType);
                if (allAccessCelebrationData.ShowAllAccessCelebration)
                {
                    showAllAccessCelebration();
                }
            }
            if (cPDataEntityCollection.TryGetComponent <MembershipData>(cPDataEntityCollection.LocalPlayerHandle, out membershipData))
            {
                membershipData.MembershipDataUpdated += onMembershipDataUpdated;
            }
        }