コード例 #1
0
        private void AddCollisionMenuItem_Click(object sender, EventArgs e)
        {
            string collisionTypeStr = (sender as ToolStripMenuItem).Tag as string;

            if (!string.IsNullOrEmpty(collisionTypeStr) &&
                Enum.TryParse(collisionTypeStr, out LDD.Primitives.Collisions.CollisionType collisionType))
            {
                var focusedBoneNode = GetFocusedParentElement <PartBone>();

                var newCollision = ProjectManager.AddCollision(collisionType, focusedBoneNode?.Element as PartBone);

                if (newCollision != null)
                {
                    SelectElementNodeDelayed(newCollision);
                }
            }
        }