Example #1
0
        protected override void SetOrientation(object target, TweenPlugVector3LookAtOptions options)
        {
            var trans = (Transform)target;

            var lookAtPt = options.lookAtPt;

            if (options.lookAtIsLocal && trans.parent)
            {
                lookAtPt = trans.parent.TransformPoint(lookAtPt);
            }

            trans.rotation = TweenPlugOrient.GetOrientation(options.orientMode, options.lockAxis, trans, lookAtPt);
        }
Example #2
0
        protected override void SetOrientation(object target, TweenPlugVector3LookAtOptions options)
        {
            var body  = (Rigidbody2D)target;
            var trans = body.transform;

            var lookAtPt = options.lookAtPt;

            if (options.lookAtIsLocal && trans.parent)
            {
                lookAtPt = trans.parent.TransformPoint(lookAtPt);
            }

            var rot = TweenPlugOrient.GetOrientation2D(options.orientMode, trans, lookAtPt);

            body.MoveRotation(rot);
        }