public static int GenerateNewId(VisualTreeAsset vta, VisualElementAsset vea) { int parentHash; if (!vea.HasParent()) { parentHash = vta.GetHashCode(); } else { parentHash = vea.parentId; } var guid = System.Guid.NewGuid().GetHashCode(); return((vta.GetNextChildSerialNumber() + 585386304) * -1521134295 + parentHash + guid); }