private static bool SetBrushFlags(Int32 brushNodeID, CSGTreeBrushFlags flags) { return(CSGManager.SetBrushFlags(brushNodeID, flags)); }
/// <summary>Generates a brush and returns a <see cref="Chisel.Core.CSGTreeBrush"/> struct that contains a reference to it.</summary> /// <param name="userID">A unique id to help identify this particular brush. For instance, this could be an InstanceID to a [UnityEngine.Object](https://docs.unity3d.com/ScriptReference/Object.html)</param> /// <param name="brushMesh">A <see cref="Chisel.Core.BrushMeshInstance"/>, which is a reference to a <see cref="Chisel.Core.BrushMesh"/>.</param> /// <param name="operation">The <see cref="Chisel.Core.CSGOperationType"/> that needs to be performed with this <see cref="Chisel.Core.CSGTreeBrush"/>.</param> /// <param name="flags"><see cref="Chisel.Core.CSGTreeBrush"/> specific flags</param> /// <returns>A new <see cref="Chisel.Core.CSGTreeBrush"/>. May be an invalid node if it failed to create it.</returns> public static CSGTreeBrush Create(Int32 userID = 0, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive, CSGTreeBrushFlags flags = CSGTreeBrushFlags.Default) { return(Create(userID, default(Matrix4x4), brushMesh, operation, flags)); }
/// <summary>Generates a brush and returns a <see cref="Chisel.Core.CSGTreeBrush"/> struct that contains a reference to it.</summary> /// <param name="userID">A unique id to help identify this particular brush. For instance, this could be an InstanceID to a [UnityEngine.Object](https://docs.unity3d.com/ScriptReference/Object.html)</param> /// <param name="localTransformation">The transformation of the brush relative to the tree root</param> /// <param name="brushMesh">A <see cref="Chisel.Core.BrushMeshInstance"/>, which is a reference to a <see cref="Chisel.Core.BrushMesh"/>.</param> /// <param name="operation">The <see cref="Chisel.Core.CSGOperationType"/> that needs to be performed with this <see cref="Chisel.Core.CSGTreeBrush"/>.</param> /// <param name="flags"><see cref="Chisel.Core.CSGTreeBrush"/> specific flags</param> /// <returns>A new <see cref="Chisel.Core.CSGTreeBrush"/>. May be an invalid node if it failed to create it.</returns> public static CSGTreeBrush Create(Int32 userID, Matrix4x4 localTransformation, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive, CSGTreeBrushFlags flags = CSGTreeBrushFlags.Default) { int brushNodeID; if (GenerateBrush(userID, out brushNodeID)) { if (localTransformation != default(Matrix4x4)) { CSGTreeNode.SetNodeLocalTransformation(brushNodeID, ref localTransformation); } if (operation != CSGOperationType.Additive) { CSGTreeNode.SetNodeOperationType(brushNodeID, operation); } if (flags != CSGTreeBrushFlags.Default) { SetBrushFlags(brushNodeID, flags); } if (brushMesh.Valid) { SetBrushMesh(brushNodeID, brushMesh); } } else { brushNodeID = 0; } return(new CSGTreeBrush() { brushNodeID = brushNodeID }); }
/// <summary>Generates a brush and returns a <see cref="Chisel.Core.CSGTreeBrush"/> struct that contains a reference to it.</summary> /// <param name="localTransformation">The transformation of the brush relative to the tree root</param> /// <param name="brushMesh">A <see cref="Chisel.Core.BrushMeshInstance"/>, which is a reference to a <see cref="Chisel.Core.BrushMesh"/>.</param> /// <param name="operation">The <see cref="Chisel.Core.CSGOperationType"/> that needs to be performed with this <see cref="Chisel.Core.CSGTreeBrush"/>.</param> /// <param name="flags"><see cref="Chisel.Core.CSGTreeBrush"/> specific flags</param> /// <returns>A new <see cref="Chisel.Core.CSGTreeBrush"/>. May be an invalid node if it failed to create it.</returns> public static CSGTreeBrush Create(Matrix4x4 localTransformation, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive, CSGTreeBrushFlags flags = CSGTreeBrushFlags.Default) { return(Create(0, localTransformation, brushMesh, operation, flags)); }
[DllImport(CSGManager.NativePluginName, CallingConvention = CallingConvention.Cdecl)] private static extern bool SetBrushFlags(Int32 brushNodeID, CSGTreeBrushFlags flags);