public void Load(List <string> loadedStringSet) { string strKey = "", strValue = ""; string strCur = ""; for (int i = 0; i < loadedStringSet.Count; i++) { strCur = loadedStringSet[i]; if (strCur.Length < 4) { continue; } strKey = strCur.Substring(0, 4); if (strCur.Length > 4) { strValue = strCur.Substring(4); } else { strValue = ""; } try { if (strKey == "NAME") { _keyName = strValue; if (string.IsNullOrEmpty(_keyName)) { _keyName = "<NoName>"; } } else if (strKey == "CATG") { _category = (apControlParam.CATEGORY) int.Parse(strValue); } else if (strKey == "ICON") { _iconPreset = (apControlParam.ICON_PRESET) int.Parse(strValue); //sw.WriteLine( + (int)_iconPreset); } else if (strKey == "VTYP") { _valueType = (apControlParam.TYPE) int.Parse(strValue); //sw.WriteLine( + (int)_valueType); } else if (strKey == "ITDF") { _int_Def = int.Parse(strValue); //sw.WriteLine("ITDF" + _int_Def); } else if (strKey == "FLDF") { _float_Def = float.Parse(strValue); //sw.WriteLine("FLDF" + _float_Def); } else if (strKey == "VXDF") { _vec2_Def.x = float.Parse(strValue); //sw.WriteLine("VXDF" + _vec2_Def.x); } else if (strKey == "VYDF") { _vec2_Def.y = float.Parse(strValue); //sw.WriteLine("VYDF" + _vec2_Def.y); } else if (strKey == "ITMN") { _int_Min = int.Parse(strValue); //sw.WriteLine("ITMN" + _int_Min); } else if (strKey == "ITMX") { _int_Max = int.Parse(strValue); //sw.WriteLine("ITMX" + _int_Max); } else if (strKey == "FLMN") { _float_Min = float.Parse(strValue); //sw.WriteLine("FLMN" + _float_Min); } else if (strKey == "FLMX") { _float_Max = float.Parse(strValue); //sw.WriteLine("FLMX" + _float_Max); } else if (strKey == "VXMN") { _vec2_Min.x = float.Parse(strValue); //sw.WriteLine("VXMN" + _vec2_Min.x); } else if (strKey == "VYMN") { _vec2_Min.y = float.Parse(strValue); //sw.WriteLine("VYMN" + _vec2_Min.y); } else if (strKey == "VXMX") { _vec2_Max.x = float.Parse(strValue); //sw.WriteLine("VXMX" + _vec2_Max.x); } else if (strKey == "VYMX") { _vec2_Max.y = float.Parse(strValue); //sw.WriteLine("VYMX" + _vec2_Max.y); } else if (strKey == "LBMN") { _label_Min = strValue; //sw.WriteLine("LBMN" + _label_Min); } else if (strKey == "LBMX") { _label_Max = strValue; //sw.WriteLine("LBMX" + _label_Max); } else if (strKey == "SNAP") { _snapSize = int.Parse(strValue); //sw.WriteLine("SNAP" + _snapSize); } else if (strKey == "UQID") { _uniqueID = int.Parse(strValue); } else if (strKey == "RSVD") { _isReserved = (int.Parse(strValue) == 1); } } catch (Exception ex) { Debug.LogError("Load Exception : " + ex); } } }
// Init //-------------------------------------------------------------- public void Init(apEditor editor, object loadKey, PARAM_TYPE paramTypeFilter, FUNC_SELECT_CONTROLPARAM_RESULT funcResult, object savedObject) { _editor = editor; _loadKey = loadKey; //_paramTypeFilter = paramTypeFilter; _funcResult = funcResult; _savedObject = savedObject; _controlParams.Clear(); List <apControlParam> cParams = _editor._portrait._controller._controlParams; for (int i = 0; i < cParams.Count; i++) { apControlParam.TYPE paramType = cParams[i]._valueType; bool isAdded = false; switch (paramType) { //case apControlParam.TYPE.Bool: // if((int)(paramTypeFilter & PARAM_TYPE.Bool) != 0) { isAdded = true; } // break; case apControlParam.TYPE.Int: if ((int)(paramTypeFilter & PARAM_TYPE.Int) != 0) { isAdded = true; } break; case apControlParam.TYPE.Float: if ((int)(paramTypeFilter & PARAM_TYPE.Float) != 0) { isAdded = true; } break; case apControlParam.TYPE.Vector2: if ((int)(paramTypeFilter & PARAM_TYPE.Vector2) != 0) { isAdded = true; } break; //case apControlParam.TYPE.Vector3: // if((int)(paramTypeFilter & PARAM_TYPE.Vector3) != 0) { isAdded = true; } // break; //case apControlParam.TYPE.Color: // if((int)(paramTypeFilter & PARAM_TYPE.Color) != 0) { isAdded = true; } // break; } if (isAdded) { _controlParams.Add(cParams[i]); } } }