protected override void InitUI(UIWidget layout) { UITransformFieldWidget transform = new UITransformFieldWidget("GameObject", _transform); transform.OnValueChanged = (object value) => { _transform = (Transform)value; }; layout.Add(transform); UIIntFieldWidget width = new UIIntFieldWidget("width", _width); width.OnValueChanged = (object value) => { _width = (int)value; }; layout.Add(width); UIIntFieldWidget height = new UIIntFieldWidget("height", _height); height.OnValueChanged = (object value) => { _height = (int)value; }; layout.Add(height); UIIntSlideFieldWidget count = new UIIntSlideFieldWidget("count", _count); count.MinValue = 1; count.MaxValue = 100; count.OnValueChanged = (object value) => { _count = (int)value; }; layout.Add(count); GUIButton btn = new GUIButton(); btn.Text = "Create"; btn.TriggerHandler = (Widget w) => { CreateGameObject(); }; layout.Add(btn); }
protected override void InitUI(UIWidget layout) { EditorVerticalLayout vLayout = new EditorVerticalLayout(); layout.Add(vLayout); UIIntPopupFieldWidget textureType = new UIIntPopupFieldWidget("Texture Type", setting.textureType); textureType.Describes = TextureTypeString; textureType.Indexs = TextureIntArray; textureType.OnValueChanged = (object value) => { setting.textureType = (TextureImporterType)value; }; vLayout.Add(textureType); UIIntPopupFieldWidget spriteMode = new UIIntPopupFieldWidget("Sprite Mode", setting.spriteMode); spriteMode.Describes = SpriteModeString; spriteMode.Indexs = IntArray; spriteMode.OnValueChanged = (object value) => { setting.spriteMode = (SpriteImportMode)value; }; vLayout.Add(spriteMode); UIBooleanFieldWidget sRGGUITexture = new UIBooleanFieldWidget("sRGGUITexture", setting.sRGGUITexture); sRGGUITexture.OnValueChanged = (object value) => { setting.sRGGUITexture = (bool)value; }; vLayout.Add(sRGGUITexture); UIIntPopupFieldWidget alphaSource = new UIIntPopupFieldWidget("Alpha Source", setting.alphaSource); alphaSource.Describes = AlphaSourceString; alphaSource.Indexs = IntArray; alphaSource.OnValueChanged = (object value) => { setting.alphaSource = (TextureImporterAlphaSource)value; }; vLayout.Add(alphaSource); UIBooleanFieldWidget alphaIsTransparency = new UIBooleanFieldWidget("Alpha Is Transparency", setting.alphaIsTransparency); alphaIsTransparency.OnValueChanged = (object value) => { setting.alphaIsTransparency = (bool)value; }; vLayout.Add(alphaIsTransparency); UIIntPopupFieldWidget filterMode = new UIIntPopupFieldWidget("Filter Mode", setting.filterMode); filterMode.Describes = FilterModeString; filterMode.Indexs = IntArray; filterMode.OnValueChanged = (object value) => { setting.filterMode = (FilterMode)value; }; vLayout.Add(filterMode); UIIntPopupFieldWidget wrapMode = new UIIntPopupFieldWidget("Wrap Mode", setting.wrapMode); wrapMode.Describes = WrapModeString; wrapMode.Indexs = IntArray; wrapMode.OnValueChanged = (object value) => { setting.wrapMode = (TextureWrapMode)value; }; vLayout.Add(wrapMode); UIIntSlideFieldWidget anisoLevel = new UIIntSlideFieldWidget("Aniso Level", setting.anisoLevel); anisoLevel.MinValue = 0; anisoLevel.MaxValue = 9; anisoLevel.OnValueChanged = (object value) => { setting.anisoLevel = (int)value; }; vLayout.Add(anisoLevel); UIIntPopupFieldWidget maxTextureSize = new UIIntPopupFieldWidget("Max Size", setting.maxTextureSize); maxTextureSize.Describes = MaxSizeString; maxTextureSize.Indexs = SizeIntArray; maxTextureSize.OnValueChanged = (object value) => { setting.maxTextureSize = (int)value; }; vLayout.Add(maxTextureSize); UIIntPopupFieldWidget textureCompression = new UIIntPopupFieldWidget("Texture Compression", setting.textureCompression); textureCompression.Describes = FormatString; textureCompression.Indexs = IntArray; textureCompression.OnValueChanged = (object value) => { setting.textureCompression = (TextureImporterCompression)value; }; vLayout.Add(maxTextureSize); EditorHorizontalLine line = new EditorHorizontalLine(); vLayout.Add(line); GUIButton btn = new GUIButton(); btn.Text = "Format"; btn.TriggerHandler = (Widget w) => { FormatTextures(); }; vLayout.Add(btn); }