Пример #1
0
        private void updateCameraFOV(float percentage, bool tween = false)
        {
            float           num             = 30f;
            float           num2            = 90f;
            AspectRatioType aspectRatioType = PlatformUtils.GetAspectRatioType();

            for (int i = 0; i < ZoomSettings.Length; i++)
            {
                if (aspectRatioType == ZoomSettings[i].Type)
                {
                    num  = ZoomSettings[i].MinFOV;
                    num2 = ZoomSettings[i].MaxFOV;
                    break;
                }
            }
            float num3  = num2 - num;
            float value = num + num3 * percentage;

            value = Mathf.Clamp(value, num, num2);
            if (tween)
            {
                TweenFOV(value);
            }
            else
            {
                myCamera.fieldOfView = value;
            }
        }
Пример #2
0
 public TSettings GetSettings(string type)
 {
     for (int i = 0; i < Types.Length; i++)
     {
         if (Types[i] == type && Settings.Length > i && PlatformUtils.GetAspectRatioType() == Settings[i].SettingsType)
         {
             return(Settings[i]);
         }
     }
     return(null);
 }
Пример #3
0
 public void OnClosePressed()
 {
     if (PlatformUtils.GetAspectRatioType() == AspectRatioType.Landscape)
     {
         Object.Destroy(base.transform.parent.parent.gameObject);
     }
     else
     {
         Object.Destroy(base.gameObject);
     }
 }
Пример #4
0
 private bool onChatBarOpened(ChatEvents.InputBarLoaded evt)
 {
     if (PlatformUtils.GetAspectRatioType() == AspectRatioType.Landscape)
     {
         StateMachine component = GetComponent <StateMachine>();
         if (component.CurrentStateName == "EmoteInput")
         {
             component.SendEvent("keyboardOpen");
         }
     }
     return(false);
 }
Пример #5
0
 private void openIglooList()
 {
     if (!isLoadingPrefab)
     {
         isLoadingPrefab = true;
         if (PlatformUtils.GetAspectRatioType() == AspectRatioType.Portrait)
         {
             ClubPenguin.SceneRefs.FullScreenPopupManager.CreatePopup(contentPrefabContentKey, "Accessibility.Popup.Title.IglooList", useCameraSpace: false, onPrefabCreated);
         }
         else
         {
             Content.LoadAsync(onContainerPrefabLoaded, containerPrefabContentKey);
         }
     }
 }
Пример #6
0
 protected override void awake()
 {
     if (PlatformUtils.GetAspectRatioType() == AspectRatioType.Landscape)
     {
         GetComponent <UIDisabler>().enabled        = false;
         GetComponent <UIDisabler>().ResetOnDestroy = false;
     }
     Service.Get <EventDispatcher>().AddListener <IglooServiceEvents.PopularIgloosListLoaded>(OnPopularIgloosListLoaded);
     Service.Get <EventDispatcher>().AddListener <IglooServiceEvents.IgloosFromZoneIdsLoaded>(onIgloosFromZoneIdsLoaded);
     dataEntityCollection.EventDispatcher.AddListener <DataEntityEvents.ComponentAddedEvent <IglooListingData> >(onIglooListingDataAdded);
     DataEntityHandle[] entitiesByType = dataEntityCollection.GetEntitiesByType <IglooListingData>();
     foreach (DataEntityHandle handle in entitiesByType)
     {
         IglooListingData component = dataEntityCollection.GetComponent <IglooListingData>(handle);
         component.IglooListingDataUpdated += onIglooListingDataUpdated;
     }
 }
Пример #7
0
        private void onInputBarFieldLoaded(InputBarField inputBarField)
        {
            if (PlatformUtils.GetAspectRatioType() == AspectRatioType.Landscape)
            {
                CoroutineRunner.Start(CheckRootState(), this, "CheckRootState");
            }
            InputBarFieldLoader obj = inputBarFieldLoader;

            obj.OnInputBarFieldLoaded = (Action <InputBarField>)Delegate.Remove(obj.OnInputBarFieldLoaded, new Action <InputBarField>(onInputBarFieldLoaded));
            InputBarField             = inputBarField;
            inputBarField.SetCharacterLimit(CharacterLimit);
            inputBarField.SetKeyboardReturnKey(NativeKeyboardReturnKey.Send);
            inputBarField.ShowSuggestions = true;
            updateStateUI();
            inputBarField.OnTextChanged          = (Action <string>)Delegate.Combine(inputBarField.OnTextChanged, new Action <string>(onTextChanged));
            inputBarField.ESendButtonClicked     = (System.Action)Delegate.Combine(inputBarField.ESendButtonClicked, new System.Action(OnSendButtonClicked));
            inputBarField.EEmojiButtonClicked    = (System.Action)Delegate.Combine(inputBarField.EEmojiButtonClicked, new System.Action(onInputBarEmojiButtonClicked));
            inputBarField.EKeyboardButtonClicked = (System.Action)Delegate.Combine(inputBarField.EKeyboardButtonClicked, new System.Action(onInputBarKeyboardButtonClicked));
        }
Пример #8
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);
        }
 private Transform getScreenCameraTarget()
 {
     return((PlatformUtils.GetAspectRatioType() == AspectRatioType.Landscape) ? PCScreenCameraTarget : ScreenCameraTarget);
 }
 private Transform getDanceCameraTarget()
 {
     return((PlatformUtils.GetAspectRatioType() == AspectRatioType.Landscape) ? PCDanceCameraTarget : DanceCameraTarget);
 }
 private CameraController getScreenCamera()
 {
     return((PlatformUtils.GetAspectRatioType() == AspectRatioType.Landscape) ? PCScreenCamera : ScreenCamera);
 }