void Start() { trans = gameObject.GetComponent <Transform>(); world = gameObject.GetComponent <MPWorld>(); dummyMesh = new Mesh(); meshes = new GameObject("MPMeshes"); gameObject.GetComponent <MeshFilter>().mesh = dummyMesh; meshData = new MPMeshData(); children = new List <GameObject>(); dataTexture = new RenderTexture(dataTextureWidth, dataTextureHeight, 0, RenderTextureFormat.ARGBFloat, RenderTextureReadWrite.Default); dataTexture.isPowerOfTwo = false; dataTexture.filterMode = FilterMode.Point; dataTexture.Create(); if (material) { material.SetTexture("_DataTex", dataTexture); material.SetFloat("_DataTexPitch", 1.0f / dataTextureWidth); } }
[DllImport("MassParticle")] public static extern void mpGenerateCubeMesh(int context, int i, ref MPMeshData md);
public static extern void mpGeneratePointMesh(int context, int i, ref MPMeshData md);
[DllImport("MassParticle")] unsafe public static extern void mpGeneratePointMesh(int i, ref MPMeshData md);