protected CodeParamType SelectTypeOutput(CodeParamType type, float width) { List <string> strs = new List <string> { "Color", "UV", "Alpha" }; return(SelectType(type, width, strs)); }
protected CodeParamType SelectTypeInput(CodeParamType type, float width) { List <string> strs = new List <string> { "Color", "UV", "Alpha", "Float", "Range", "CustomParam" }; return(SelectType(type, width, strs)); }
public SWDataCode(string _name, CodeParamType _outType) { name = _name; description = ""; output = new CodeParam("o", _outType); inputs = new List <CodeParam> (); code = ""; }
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); }
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); }
public CodeParam(string _name, CodeParamType _type) { name = _name; type = _type; }