예제 #1
0
        protected CodeParamType SelectTypeOutput(CodeParamType type, float width)
        {
            List <string> strs = new List <string> {
                "Color", "UV", "Alpha"
            };

            return(SelectType(type, width, strs));
        }
예제 #2
0
        protected CodeParamType SelectTypeInput(CodeParamType type, float width)
        {
            List <string> strs = new List <string> {
                "Color", "UV", "Alpha", "Float", "Range", "CustomParam"
            };

            return(SelectType(type, width, strs));
        }
예제 #3
0
 public SWDataCode(string _name, CodeParamType _outType)
 {
     name        = _name;
     description = "";
     output      = new CodeParam("o", _outType);
     inputs      = new List <CodeParam> ();
     code        = "";
 }
예제 #4
0
        public List <string> CodeOfCate(CodeParamType type)
        {
            List <string> list = new List <string> ();

            foreach (var item in codes)
            {
                if (item.output.type == type)
                {
                    list.Add(item.name);
                }
            }
            return(list);
        }
예제 #5
0
        protected CodeParamType SelectType(CodeParamType type, float width, List <string> strs)
        {
            int index = strs.IndexOf(type.ToString());
            var temp  = EditorGUILayout.Popup("", index, strs.ToArray(), GUILayout.Width(width));

            if (temp != index)
            {
                index = temp;
                //performance impact
                //type = (CodeParamType)Enum.Parse(typeof(CodeParamType),strs[index]);
                type = (CodeParamType)index;
            }
            return(type);
        }
예제 #6
0
 public CodeParam(string _name, CodeParamType _type)
 {
     name = _name;
     type = _type;
 }