public IPatternConverter CreateConverter(MeshManager manager, Vector3 position, Quaternion rotation, Vector3 scale, byte blockMat, Material meshMat) { GameObject go = new GameObject("MeshPatternConverter"); go.transform.position = position; go.transform.rotation = rotation; go.transform.localScale = scale; Scheduler.StartCoroutine(CreateMeshObject( go, faces, meshMat, LayerMask.NameToLayer("Voxel"), (blockMat != MeshManager.kVoxelSubtract))); MeshPatternConverter pc = go.AddComponent <MeshPatternConverter>(); pc.Init(this, manager, position, rotation, scale, blockMat, meshMat); return(pc); }
public void RedoAction(MeshManager manager, DeltaDoneDelegate onDone) { if (m_data == null) { blobDelta.RedoAction(manager, onDone); return; } GameObject go = new GameObject("MeshPatternConverter"); m_converter = go.AddComponent <MeshPatternConverter>(); m_converter.Init(manager, m_data, this); Scheduler.StartCoroutine(MeshPattern.CreateMeshObject(go, m_data.faces, m_data.meshMat, LayerMask.NameToLayer("Voxel"), (m_data.material != MeshManager.kVoxelSubtract))); m_currentCallback = onDone; blobDelta.RedoAction(manager, RestartConverter); }