public AdvFaceIconInfo(StringGridRow row) { this.FileName = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Icon, ""); if (!string.IsNullOrEmpty(FileName)) { if (!AdvParser.IsEmptyCell(row, AdvColumnName.IconSubFileName)) { this.IconType = AdvFaceIconInfo.Type.DicingPattern; this.IconSubFileName = AdvParser.ParseCell <string>(row, AdvColumnName.IconSubFileName); } else { this.IconType = AdvFaceIconInfo.Type.IconImage; } } else if (!AdvParser.IsEmptyCell(row, AdvColumnName.IconRect)) { float[] rect = row.ParseCellArray <float>(AdvColumnName.IconRect.QuickToString()); if (rect.Length == 4) { this.IconType = AdvFaceIconInfo.Type.RectImage; this.IconRect = new Rect(rect[0], rect[1], rect[2], rect[3]); } else { Debug.LogError(row.ToErrorString("IconRect. Array size is not 4")); } } else { this.IconType = Type.None; } }
public void Parse(StringGridRow row) { this.RenderTextureType = AdvParser.ParseCellOptional <AdvRenderTextureMode>(row, AdvColumnName.RenderTexture, AdvRenderTextureMode.None); if (RenderTextureType != AdvRenderTextureMode.None) { try { float[] rect = row.ParseCellArray <float>(AdvColumnName.RenderRect.QuickToString()); if (rect.Length != 4) { Debug.LogError(row.ToErrorString("IconRect. Array size is not 4")); } else { this.RenderTextureOffset = new Vector3(-rect[0], -rect[1], 1000); this.RenderTextureSize = new Vector2(rect[2], rect[3]); } } catch (Exception) { // Debug.LogError(row.ToErrorString("IconRect. Array size is not 4")); } } }