Beispiel #1
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;
            }
        }
Beispiel #2
0
        private bool showAllAccess()
        {
            AllAccessService allAccessService = Service.Get <AllAccessService>();

            if (allAccessService.IsAllAccessActive())
            {
                CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
                if (cPDataEntityCollection.TryGetComponent <DisplayNameData>(cPDataEntityCollection.LocalPlayerHandle, out var component))
                {
                    string allAccessEventKey = allAccessService.GetAllAccessEventKey();
                    if (!AllAccessHelper.HasSeenAllAccessFlow(allAccessEventKey, component.DisplayName))
                    {
                        AllAccessHelper.SetHasSeenAllAccessFlow(allAccessEventKey, component.DisplayName);
                        DataEntityHandle         handle = cPDataEntityCollection.AddEntity("AllAccessCelebrationData");
                        AllAccessCelebrationData allAccessCelebrationData = cPDataEntityCollection.AddComponent <AllAccessCelebrationData>(handle);
                        allAccessCelebrationData.ShowAllAccessCelebration = true;
                        return(true);
                    }
                }
            }
            return(false);
        }