//\this being here will save GC allocs // Use this for initialization void Awake() { _transform = transform; _joint = GetComponent <GymanJoint>(); _update_action = new UnityAction[] { update__collision }; }
float custom_direct_leg(GymanJoint joint, GymanJoint child_joint, Vector2 direction) { _ccc = joint.world_direction.get_angle_to(direction); if (_ccc > -15f && _ccc < 15f) // выравнивание тела, если выровнены ноги { _ccc = joint.hinge_joint_2D.jointAngle * -.1f * _ccc / 15f; } _ccc += joint.hinge_joint_2D.jointAngle; _ddd = 0; joint.limit_angle(ref _ccc, ref _ddd); joint.apply_target_angle(_ccc); child_joint.apply_target_angle(_ddd, true); return(_ddd); }
void Awake() { _transform = transform; _slider = GetComponent <SliderJoint2D>(); _arm_joint = GetComponent <GymanJoint>(); _hand_joint = HandU.GetComponent <GymanJoint>(); _grab = HandU.GetComponent <als_grab>(); _lfinger = FingerL.GetComponent <HingeJoint2D>(); _rfinger = FingerR.GetComponent <HingeJoint2D>(); _update_action = new UnityEngine.Events.UnityAction[] { update__wait_stretch, update__wait_fold }; }