示例#1
0
 internal PlatformIconField(PlatformIcon platformIcon, BuildTargetGroup targetGroup)
 {
     this.platformIcon   = platformIcon;
     this.m_TargetGroup  = targetGroup;
     this.m_HeaderString = this.platformIcon.description;
     this.m_SizeLabel    = string.Format("{0}x{1}px", platformIcon.width, platformIcon.height);
 }
        internal PlatformIconField CreatePlatformIconField(PlatformIcon icon)
        {
            if (icon.maxLayerCount > 1)
            {
                return(new PlatformIconFieldMultiLayer(icon, targetGroup));
            }

            return(new PlatformIconFieldSingleLayer(icon, targetGroup));
        }
        internal PlatformIconField CreatePlatformIconField(PlatformIcon icon)
        {
            PlatformIconField result;

            if (icon.maxLayerCount > 1)
            {
                result = new PlatformIconFieldMultiLayer(icon, this.targetGroup);
            }
            else
            {
                result = new PlatformIconFieldSingleLayer(icon, this.targetGroup);
            }
            return(result);
        }
        internal PlatformIconFieldMultiLayer(PlatformIcon platformIcon, BuildTargetGroup targetGroup) : base(platformIcon, targetGroup)
        {
            bool flag         = base.platformIcon.minLayerCount != base.platformIcon.maxLayerCount;
            bool showControls = flag;

            this.m_IconLayers = new ReorderableIconLayerList(true, showControls);
            this.m_IconLayers.headerString = string.Format("{0} ({1})", base.platformIcon.description, this.m_SizeLabel);
            this.m_IconLayers.minItems     = base.platformIcon.minLayerCount;
            this.m_IconLayers.maxItems     = base.platformIcon.maxLayerCount;
            string[] customLayerLabels = platformIcon.kind.customLayerLabels;
            if (customLayerLabels != null && customLayerLabels.Length > 0)
            {
                this.m_IconLayers.SetElementLabels(platformIcon.kind.customLayerLabels);
            }
            int num    = 86;
            int height = (int)((float)platformIcon.height / (float)platformIcon.height * (float)num);

            this.m_IconLayers.SetImageSize(num, height);
            this.m_IconLayers.textures = platformIcon.GetTextures().ToList <Texture2D>();
            this.EnsureMinimumNumberOfTextures();
        }
        internal PlatformIconFieldMultiLayer(PlatformIcon platformIcon, BuildTargetGroup targetGroup) : base(platformIcon, targetGroup)
        {
            bool showControls = this.platformIcon.minLayerCount != this.platformIcon.maxLayerCount;

            m_IconLayers = new ReorderableIconLayerList(platformIcon.draggable, showControls);
            m_IconLayers.headerString = string.Format("{0} ({1})", this.platformIcon.description, m_SizeLabel);
            m_IconLayers.minItems     = this.platformIcon.minLayerCount;
            m_IconLayers.maxItems     = this.platformIcon.maxLayerCount;

            string[] customLayerLabels = platformIcon.kind.customLayerLabels;
            if (customLayerLabels != null && customLayerLabels.Length > 0)
            {
                m_IconLayers.SetElementLabels(platformIcon.kind.customLayerLabels);
            }

            int slotWidth  = kMaxPreviewSize;
            int slotHeight = (int)((float)platformIcon.height / platformIcon.height * slotWidth);

            m_IconLayers.SetImageSize(slotWidth, slotHeight);

            m_IconLayers.textures = platformIcon.GetTextures().ToList();
            EnsureMinimumNumberOfTextures();
        }
 internal PlatformIconFieldSingleLayer(PlatformIcon platformIcon, BuildTargetGroup targetGroup) : base(platformIcon, targetGroup)
 {
     m_PlatformName = PlayerSettings.GetPlatformName(m_TargetGroup);
 }