BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

PropertyBinding.unbind()

PropertyBinding.unbind() 方法用于将属性绑定解绑定。

语法

PropertyBinding.unbind();

描述

PropertyBinding.unbind() 方法用于解绑定当前属性绑定。解绑定后,属性绑定对象将被从对象和属性路径中移除。

示例

const object = { position: new Vector3( 0, 0, 0 ) };
const path = "position.z";

const binding = new PropertyBinding( object, path );

// 绑定属性
binding.bind();

// 改变属性值
object.position.z = 10;

// 输出变化后的属性值
console.log( binding.getValue() ); // 10

// 解绑定属性
binding.unbind();

// 再次改变属性值
object.position.z = 20;

// 输出变化后的属性值
console.log( binding.getValue() ); // 10

参考