public static void updateSCANresource (SCANresourceGlobal r, bool all) { SCANresourceGlobal update = getResourceNode(r.Name); if (update != null) { update.MinColor = r.MinColor; update.MaxColor = r.MaxColor; update.Transparency = r.Transparency; if (all) { for (int i = 0; i < update.getBodyCount; i++) { SCANresourceBody b = update.getBodyConfig(i); if (b != null) { SCANresourceBody bNew = r.getBodyConfig(b.BodyName); if (bNew != null) { b.MinValue = bNew.MinValue; b.MaxValue = bNew.MaxValue; } } } } else { SCANresourceBody b = update.getBodyConfig(r.CurrentBody.BodyName); if (b != null) { b.MinValue = r.CurrentBody.MinValue; b.MaxValue = r.CurrentBody.MaxValue; } } } }
private string saveResources(SCANresourceGlobal resource) { List<string> sL = new List<string>(); for (int j = 0; j < resource.getBodyCount; j++) { SCANresourceBody bodyRes = resource.getBodyConfig(j); if (bodyRes != null) { string a = string.Format("{0}|{1:F3}|{2:F3}", bodyRes.Index, bodyRes.MinValue, bodyRes.MaxValue); sL.Add(a); } } return string.Join(",", sL.ToArray()); }