MD Package Technical & APi Documentation
MDM_AngularBend :: MD_ModifierBase
Namespace: MDPackage.Modifiers
Angular Bend modifier by the specific value to the specific direction.
Read more here (Online documentation slide)
Properties
public float BendValue { get; set; }
public float BendAngle { get; set; }
Public Methods
// Refresh & register current mesh state. This will override the backup vertices to the current mesh state
public void Bend_RegisterCurrentState()
Examples
The following paragraphs contain Angular Bend modifier used in a practical example.
using UnityEngine;
using MDPackage.Modifiers;

[RequireComponent(typeof(MeshFilter))]
public class SampleScript : MonoBehaviour
{
private MDM_AngularBend bend;

private void Start()
 {
  // Add/Create a bend modifier to this object right after start
  bend = MD_ModifierBase.CreateModifier<MDM_AngularBend>(gameObject, MD_ModifierBase.MeshReferenceType.CreateNewReference);
  bend.BendValue = 24; // Set value
  // Update current modifier every frame
  bend.MbUpdateEveryFrame = true;
  // Otherwise it can be updated manually by calling...
  // bend.MDModifier_ProcessModifier();
 }

private void Update()
 {
  // Sample bend processing
  bend.BendAngle = Mathf.Sin(Time.time * 2.0f) * 180f;
  // Sample extension - if space is pressed, increase the vertex count if possible
  if (Input.GetKeyDown(KeyCode.Space))
   bend.MDModifier_SubdivideMesh();
  // Sample extension - if R is pressed, restore mesh to its original state
  if (Input.GetKeyDown(KeyCode.R))
   bend.MDModifier_RestoreMesh();
 }