Skip to content

boneOrientationVector should be private #12

Open
@KosRud

Description

@KosRud

/// <summary>
/// Bone orientation is required for bulge-compensation.<br>
/// Do not set directly, use custom editor instead.
/// </summary>
public Vector3 boneOrientationVector = Vector3.up;

Use private field with SerializeField and public getter/setter functions. Do not use property, use functions to emphasize that changing the value requires additional internal logic and can be expensive.

Logic for setter:

var newOrientation = (BoneOrientation)EditorGUILayout.EnumPopup("Bone orientation: ", currentOrientation);
if (this.dqs.boneOrientationVector != this.boneOrientationVectors[newOrientation])
{
this.dqs.boneOrientationVector = this.boneOrientationVectors[newOrientation];
this.dqs.UpdatePerVertexCompensationCoef();
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions