static void CheckMeshDataAsset(ref long meshID, IvyDataAsset myAsset, IvyProfile.MeshCompression meshCompress) { if (meshID == 0) { meshID = IvyRoot.GetRandomLong(); } if (!myAsset.meshList.ContainsKey(meshID) || myAsset.meshList[meshID] == null) { var newMesh = new Mesh(); MeshUtility.SetMeshCompression(newMesh, (ModelImporterMeshCompression)meshCompress); AssetDatabase.AddObjectToAsset(newMesh, AssetDatabase.GetAssetPath(myAsset)); if (myAsset.meshList.ContainsKey(meshID) && myAsset.meshList[meshID] == null) { myAsset.meshList[meshID] = newMesh; } else { myAsset.meshList.Add(meshID, newMesh); } } }
public IvyGraph() { branchMeshID = IvyRoot.GetRandomLong(); leafMeshID = IvyRoot.GetRandomLong(); }