Exemple #1
0
        public void Init(SWGradient _gradient)
        {
            gradient = _gradient;

            icon       = EditorGUIUtility.Load("gradient_down_swatch") as Texture;
            iconSelect = EditorGUIUtility.Load("gradient_down_swatch_overlay_on") as Texture;
        }
Exemple #2
0
        public void UpdatePort()
        {
            int portNumForMix = data.childPortNumber - 1;

            if (portNumForMix < data.gradients.Count)
            {
                for (int i = data.gradients.Count - 1; i >= 0; i--)
                {
                    if (i >= portNumForMix)
                    {
                        data.gradients.RemoveAt(i);
                    }
                }
            }
            if (portNumForMix > data.gradients.Count)
            {
                while (data.gradients.Count < portNumForMix)
                {
                    var newGradient = new SWGradient();
                    newGradient.UpdateTex();
                    data.gradients.Add(newGradient);
                }
            }

            var tempNodeAll = window.NodeAll();

            for (int i = data.children.Count - 1; i >= 0; i--)
            {
                if (data.childrenPort [i] >= data.childPortNumber)
                {
                    string child = data.children [i];
                    RemoveConnection(this, tempNodeAll[child]);
                }
            }
        }
Exemple #3
0
        public static void Show(SWGradient _gradient)
        {
            var edit = EditorWindow.GetWindow <SWWindowMixerEditor> (true, "Mixer Editor");

            edit.minSize = new Vector2(400, 160);
            edit.Init(_gradient);
        }
Exemple #4
0
        public void Init(SWGradient _gradient)
        {
            gradient = _gradient;

            icon       = EditorGUIUtility.Load("gradient_down_swatch") as Texture;
            iconSelect = EditorGUIUtility.Load("gradient_down_swatch_overlay_on") as Texture;

            if (gradient.frames.Count > 0)
            {
                opItem = gradient.frames [0];
            }
        }