コード例 #1
0
        public override IEnumerator PerformFirstPass()
        {
            ConditionalConfiguration instance = new ConditionalConfiguration(Service.Get <GameData>().Get <ConditionalDefinition[]>());

            Service.Set(instance);
            yield break;
        }
コード例 #2
0
        private void loadApplet(CellPhoneEvents.ChangeCellPhoneScreen evt, PrefabContentKey prefabKey)
        {
            ConditionalConfiguration conditionalConfiguration = Service.Get <ConditionalConfiguration>();
            int num = conditionalConfiguration.Get("System.Memory.property", 0);

            if (evt.AppletSceneSystemMemoryThreshold >= 0 && num <= evt.AppletSceneSystemMemoryThreshold)
            {
                loadAppletScene(evt, prefabKey);
                return;
            }
            loadScreen(prefabKey, showLoadingScreen: false);
            CoroutineRunner.Start(runLoadingScreenTimer(), this, "CellPhoneLoadingScreenTimer");
        }
コード例 #3
0
        private bool onChangeScreen(CellPhoneEvents.ChangeCellPhoneScreen evt)
        {
            switch (evt.Behaviour)
            {
            case CellPhoneAppBehaviour.LoadScene:
                if (string.IsNullOrEmpty(evt.BehaviourParam))
                {
                    Log.LogError(this, "Cell phone load scene param not set for LoadScene");
                }
                else
                {
                    loadScene(evt, evt.BehaviourParam, null);
                }
                break;

            case CellPhoneAppBehaviour.ChangeScreen:
            {
                if (string.IsNullOrEmpty(evt.BehaviourParam))
                {
                    Log.LogError(this, "Cell phone change screen param not set for ChangeScreen");
                    break;
                }
                PrefabContentKey prefabKey = new PrefabContentKey(evt.BehaviourParam);
                loadApplet(evt, prefabKey);
                break;
            }

            case CellPhoneAppBehaviour.LoadSettings:
            {
                ConditionalConfiguration conditionalConfiguration = Service.Get <ConditionalConfiguration>();
                int num = conditionalConfiguration.Get("System.Memory.property", 0);
                if (PlatformUtils.GetAspectRatioType() == AspectRatioType.Portrait || (evt.AppletSceneSystemMemoryThreshold >= 0 && num <= evt.AppletSceneSystemMemoryThreshold))
                {
                    loadScene(evt, "Settings", null);
                    break;
                }
                PrefabContentKey prefabKey = new PrefabContentKey(evt.BehaviourParam);
                loadScreen(prefabKey);
                break;
            }
            }
            return(false);
        }
コード例 #4
0
    public void Start()
    {
        ConditionalConfiguration conditionalConfiguration = Service.Get <ConditionalConfiguration>();

        Model.LodLevel = conditionalConfiguration.Get("AvatarSystem.LODLevel.property", 0);
        ZoneLocalPlayerManager zoneLocalPlayerManager = ClubPenguin.SceneRefs.ZoneLocalPlayerManager;

        isLocal = (zoneLocalPlayerManager.LocalPlayerGameObject == base.gameObject);
        if (isLocal ? CombineLocal : CombineRemote)
        {
            base.gameObject.SetActive(value: false);
            AvatarViewCombined avatarViewCombined = base.gameObject.AddComponent <AvatarViewCombined>();
            avatarViewCombined.UseGpuSkinning    = UseGpuSkinning;
            avatarViewCombined.MaxAtlasDimension = conditionalConfiguration.Get("AvatarSystem.MaxAtlasDimension.property", 512);
            base.gameObject.SetActive(value: true);
            avatarView = avatarViewCombined;
        }
        else
        {
            avatarView = base.gameObject.AddComponent <AvatarViewDistinct>();
        }
        if (isLocal)
        {
            zoneLocalPlayerManager.AssignAvatarView(avatarView);
        }
        base.gameObject.AddComponent <PlayerMediator>();
        avatarView.OnBusy  += avatarView_OnBusy;
        avatarView.OnReady += avatarView_OnReady;
        bool flag = true;

        if (AvatarDataHandle.TryGetPlayerHandle(base.gameObject, out DataEntityHandle handle) && dataEntityCollection.TryGetComponent(handle, out avatarDetailsData))
        {
            processAvatarDetails(handle);
            flag = false;
        }
        if (flag)
        {
            dataEntityCollection.EventDispatcher.AddListener <DataEntityEvents.ComponentAddedEvent <AvatarDetailsData> >(onAvatarDetailsAdded);
            Model.ClearAllEquipment();
        }
    }