public void OnEnable()
        {
            this.m_ResolutionDialogBanner = this.m_Owner.FindPropertyAssert("resolutionDialogBanner");
            this.m_ShowUnitySplashLogo    = this.m_Owner.FindPropertyAssert("m_ShowUnitySplashLogo");
            this.m_ShowUnitySplashScreen  = this.m_Owner.FindPropertyAssert("m_ShowUnitySplashScreen");
            this.m_SplashScreenAnimation  = this.m_Owner.FindPropertyAssert("m_SplashScreenAnimation");
            this.m_SplashScreenBackgroundAnimationZoom = this.m_Owner.FindPropertyAssert("m_SplashScreenBackgroundAnimationZoom");
            this.m_SplashScreenBackgroundColor         = this.m_Owner.FindPropertyAssert("m_SplashScreenBackgroundColor");
            this.m_SplashScreenBackgroundLandscape     = this.m_Owner.FindPropertyAssert("splashScreenBackgroundSourceLandscape");
            this.m_SplashScreenBackgroundPortrait      = this.m_Owner.FindPropertyAssert("splashScreenBackgroundSourcePortrait");
            this.m_SplashScreenDrawMode          = this.m_Owner.FindPropertyAssert("m_SplashScreenDrawMode");
            this.m_SplashScreenLogoAnimationZoom = this.m_Owner.FindPropertyAssert("m_SplashScreenLogoAnimationZoom");
            this.m_SplashScreenLogos             = this.m_Owner.FindPropertyAssert("m_SplashScreenLogos");
            this.m_SplashScreenLogoStyle         = this.m_Owner.FindPropertyAssert("m_SplashScreenLogoStyle");
            this.m_SplashScreenOverlayOpacity    = this.m_Owner.FindPropertyAssert("m_SplashScreenOverlayOpacity");
            this.m_VirtualRealitySplashScreen    = this.m_Owner.FindPropertyAssert("m_VirtualRealitySplashScreen");
            this.m_LogoList = new ReorderableList(this.m_Owner.serializedObject, this.m_SplashScreenLogos, true, true, true, true);
            this.m_LogoList.elementHeight      = PlayerSettingsSplashScreenEditor.k_LogoListElementHeight;
            this.m_LogoList.footerHeight       = PlayerSettingsSplashScreenEditor.k_LogoListFooterHeight;
            this.m_LogoList.onAddCallback      = new ReorderableList.AddCallbackDelegate(this.OnLogoListAddCallback);
            this.m_LogoList.drawHeaderCallback = new ReorderableList.HeaderCallbackDelegate(this.DrawLogoListHeaderCallback);
            ReorderableList arg_1C6_0 = this.m_LogoList;

            if (PlayerSettingsSplashScreenEditor.< > f__mg$cache0 == null)
            {
                PlayerSettingsSplashScreenEditor.< > f__mg$cache0 = new ReorderableList.CanRemoveCallbackDelegate(PlayerSettingsSplashScreenEditor.OnLogoListCanRemoveCallback);
            }
            arg_1C6_0.onCanRemoveCallback              = PlayerSettingsSplashScreenEditor.< > f__mg$cache0;
            this.m_LogoList.drawElementCallback        = new ReorderableList.ElementCallbackDelegate(this.DrawLogoListElementCallback);
            this.m_LogoList.drawFooterCallback         = new ReorderableList.FooterCallbackDelegate(this.DrawLogoListFooterCallback);
            this.m_ShowAnimationControlsAnimator.value = (this.m_SplashScreenAnimation.intValue == 2);
            this.m_ShowAnimationControlsAnimator.valueChanged.AddListener(new UnityAction(this.m_Owner.Repaint));
            this.m_ShowBackgroundColorAnimator.value = (this.m_SplashScreenBackgroundLandscape.objectReferenceValue == null);
            this.m_ShowBackgroundColorAnimator.valueChanged.AddListener(new UnityAction(this.m_Owner.Repaint));
            this.m_ShowLogoControlsAnimator.value = this.m_ShowUnitySplashLogo.boolValue;
            this.m_ShowLogoControlsAnimator.valueChanged.AddListener(new UnityAction(this.m_Owner.Repaint));
            if (PlayerSettingsSplashScreenEditor.s_UnityLogo == null)
            {
                PlayerSettingsSplashScreenEditor.s_UnityLogo = Resources.GetBuiltinResource <Sprite>("UnitySplash-cube.png");
            }
        }
예제 #2
0
        public static CachedReorderableList GetListDrawer(SerializedProperty property, ReorderableList.HeaderCallbackDelegate drawHeaderCallback, ReorderableList.ElementHeightCallbackDelegate getElementHeightCallback, ReorderableList.ElementCallbackDelegate drawElementCallback,
                                                          ReorderableList.FooterCallbackDelegate drawFooterCallback         = null,
                                                          ReorderableList.AddCallbackDelegate onAddCallback                 = null, ReorderableList.RemoveCallbackDelegate onRemoveCallback   = null, ReorderableList.SelectCallbackDelegate onSelectCallback = null,
                                                          ReorderableList.ChangedCallbackDelegate onChangedCallback         = null, ReorderableList.ReorderCallbackDelegate onReorderCallback = null, ReorderableList.CanRemoveCallbackDelegate onCanRemoveCallback = null,
                                                          ReorderableList.AddDropdownCallbackDelegate onAddDropdownCallback = null)
        {
            if (property == null)
            {
                throw new System.ArgumentNullException("property");
            }
            if (!property.isArray)
            {
                throw new System.ArgumentException("SerializedProperty must be a property for an Array or List", "property");
            }

            int hash = GetPropertyHash(property);
            CachedReorderableList lst;

            if (_lstCache.TryGetValue(hash, out lst))
            {
                lst.ReInit(property.serializedObject, property);
            }
            else
            {
                lst             = new CachedReorderableList(property.serializedObject, property);
                _lstCache[hash] = lst;
            }
            lst.drawHeaderCallback    = drawHeaderCallback;
            lst.elementHeightCallback = getElementHeightCallback;
            lst.drawElementCallback   = drawElementCallback;
            lst.drawFooterCallback    = drawFooterCallback;
            lst.onAddCallback         = onAddCallback;
            lst.onRemoveCallback      = onRemoveCallback;
            lst.onSelectCallback      = onSelectCallback;
            lst.onChangedCallback     = onChangedCallback;
            lst.onReorderCallback     = onReorderCallback;
            lst.onCanRemoveCallback   = onCanRemoveCallback;
            lst.onAddDropdownCallback = onAddDropdownCallback;

            return(lst);
        }
        /// <summary>
        /// Creates a cached ReorderableList that can be used on a IList. The serializedProperty passed is used for look-up and is not used in the ReorderableList itself.
        /// </summary>
        /// <param name="memberList"></param>
        /// <param name="tokenProperty"></param>
        /// <param name="drawHeaderCallback"></param>
        /// <param name="drawElementCallback"></param>
        /// <param name="onAddCallback"></param>
        /// <param name="onRemoveCallback"></param>
        /// <param name="onSelectCallback"></param>
        /// <param name="onChangedCallback"></param>
        /// <param name="onReorderCallback"></param>
        /// <param name="onCanRemoveCallback"></param>
        /// <param name="onAddDropdownCallback"></param>
        /// <returns></returns>
        public static CachedReorderableList GetListDrawer(System.Collections.IList memberList, SerializedProperty tokenProperty, ReorderableList.HeaderCallbackDelegate drawHeaderCallback, ReorderableList.ElementCallbackDelegate drawElementCallback,
                                                          ReorderableList.AddCallbackDelegate onAddCallback                 = null, ReorderableList.RemoveCallbackDelegate onRemoveCallback   = null, ReorderableList.SelectCallbackDelegate onSelectCallback = null,
                                                          ReorderableList.ChangedCallbackDelegate onChangedCallback         = null, ReorderableList.ReorderCallbackDelegate onReorderCallback = null, ReorderableList.CanRemoveCallbackDelegate onCanRemoveCallback = null,
                                                          ReorderableList.AddDropdownCallbackDelegate onAddDropdownCallback = null)
        {
            if (memberList == null)
            {
                throw new System.ArgumentNullException("memberList");
            }
            if (tokenProperty == null)
            {
                throw new System.ArgumentNullException("property");
            }

            int hash = PropertyHandlerCache.GetIndexRespectingPropertyHash(tokenProperty);
            CachedReorderableList lst;

            if (_lstCache.TryGetValue(hash, out lst))
            {
                lst.ReInit(memberList);
            }
            else
            {
                lst             = new CachedReorderableList(memberList);
                _lstCache[hash] = lst;
            }

            lst.drawHeaderCallback    = drawHeaderCallback;
            lst.drawElementCallback   = drawElementCallback;
            lst.onAddCallback         = onAddCallback;
            lst.onRemoveCallback      = onRemoveCallback;
            lst.onSelectCallback      = onSelectCallback;
            lst.onChangedCallback     = onChangedCallback;
            lst.onReorderCallback     = onReorderCallback;
            lst.onCanRemoveCallback   = onCanRemoveCallback;
            lst.onAddDropdownCallback = onAddDropdownCallback;

            return(lst);
        }