コード例 #1
0
        void OnGUI()
        {
            this.minSize = new Vector2(this.minSize.x, this.position.width * (5f / 8f));

            EditorGUI.BeginChangeCheck();

            float height = this.position.height;
            float width  = this.position.width - 264f;

            DrawTexturePanel(new Rect(0f, 0f, 256f, height));

            DrawSettingsPanel(new Rect(264f, 8f, width * 0.4f, height));

            if (EditorGUI.EndChangeCheck())
            {
                UpdateTexture();
            }

            DrawResultPanel(new Rect(264f + width * 0.4f, 8f, width * 0.6f, height));

            if (Event.current.commandName == "ObjectSelectorClosed")
            {
                if (EditorGUIUtility.GetObjectPickerControlID() == 10)
                {
                    addedTextures.Clear();
                    addedTextures.Add((Texture2D)EditorGUIUtility.GetObjectPickerObject());
                }
                else if (EditorGUIUtility.GetObjectPickerControlID() == 11)
                {
                    if (EditorGUIUtility.GetObjectPickerObject() == null)
                    {
                        return;
                    }

                    addedEffect = (IAtlasGenEffect)IAtlasGenEffect.CreateInstance(EditorGUIUtility.GetObjectPickerObject().GetType());
                    if (effects.Contains(addedEffect))
                    {
                        addedEffect = null;
                    }
                }
            }
        }
コード例 #2
0
        void AddEffect(object obj)
        {
            MonoScript script = (MonoScript)obj;

            addedEffect = (IAtlasGenEffect)IAtlasGenEffect.CreateInstance(script.GetClass());
        }