Пример #1
0
        protected override void OnEnable()
        {
            BetterImage img = target as BetterImage;

            this.materialDrawer = new ImageAppearanceProviderEditorHelper(base.serializedObject, img);

            base.OnEnable();
            this.m_SpriteContent     = new GUIContent("Source Image");
            this.m_SpriteTypeContent = new GUIContent("Image Type");
            this.m_ClockwiseContent  = new GUIContent("Clockwise");
            this.m_Sprite            = base.serializedObject.FindProperty("m_Sprite");
            this.m_Type           = base.serializedObject.FindProperty("m_Type");
            this.m_FillCenter     = base.serializedObject.FindProperty("m_FillCenter");
            this.m_FillMethod     = base.serializedObject.FindProperty("m_FillMethod");
            this.m_FillOrigin     = base.serializedObject.FindProperty("m_FillOrigin");
            this.m_FillClockwise  = base.serializedObject.FindProperty("m_FillClockwise");
            this.m_FillAmount     = base.serializedObject.FindProperty("m_FillAmount");
            this.m_PreserveAspect = base.serializedObject.FindProperty("m_PreserveAspect");


            this.m_ShowType = new AnimBool(this.m_Sprite.objectReferenceValue != null);
            this.m_ShowType.valueChanged.AddListener(new UnityAction(this.Repaint));
            Image.Type mType = (Image.Type) this.m_Type.enumValueIndex;
            this.m_ShowSlicedOrTiled = new AnimBool((this.m_Type.hasMultipleDifferentValues ? false : mType == Image.Type.Sliced));
            this.m_ShowSliced        = new AnimBool((this.m_Type.hasMultipleDifferentValues ? false : mType == Image.Type.Sliced));
            this.m_ShowFilled        = new AnimBool((this.m_Type.hasMultipleDifferentValues ? false : mType == Image.Type.Filled));
            this.m_ShowSlicedOrTiled.valueChanged.AddListener(new UnityAction(this.Repaint));
            this.m_ShowSliced.valueChanged.AddListener(new UnityAction(this.Repaint));
            this.m_ShowFilled.valueChanged.AddListener(new UnityAction(this.Repaint));
            this.SetShowNativeSize(true);
        }
Пример #2
0
        protected override void OnEnable()
        {
            base.OnEnable();

            BetterRawImage img = this.target as BetterRawImage;

            this.materialDrawer = new ImageAppearanceProviderEditorHelper(base.serializedObject, img);

            this.m_UVRectContent = new GUIContent("UV Rect");
            this.m_Texture       = base.serializedObject.FindProperty("m_Texture");
            this.m_UVRect        = base.serializedObject.FindProperty("m_UVRect");
            this.SetShowNativeSize(true);
        }