Exemplo n.º 1
0
    /// <summary>
    /// Process a property for a pointConstraint node
    /// </summary>
    /// <param name="go">
    /// A <see cref="GameObject"/>
    /// </param>
    /// <param name="nodeName">
    /// A <see cref="System.String"/>
    /// </param>
    /// <param name="attributeName">
    /// A <see cref="System.String"/>
    /// </param>
    /// <param name="val">
    /// A <see cref="System.Object"/>
    /// </param>
    void ProcessPointConstraintProperty(GameObject go, string nodeName, string attributeName, System.Object val)
    {
        PointConstraint node = GetMayaNodeOnGameObject(nodeName, typeof(PointConstraint), go) as PointConstraint;

        node.constrainedObject = go.transform;
        switch (attributeName)
        {
        case "offset":
            node.offset = (Vector4)val;
            break;

        case "constraintOffsetPolarity":
            node.constraintOffsetPolarity = (float)val;
            break;

        default:
            if (IsConstraintWeightAttribute(attributeName))
            {
                node.InsertTargetUsingWeightAttribute(attributeName, (float)val);
            }
            if (IsConstraintTargetAttribute(attributeName))
            {
                node.InsertTargetUsingTargetAttribute(attributeName, val as string);
            }
            break;
        }
    }