Esempio n. 1
0
	public bool JointTo(Transform target) {
		ComponentJoint componentjoint = target.GetComponent<ComponentJoint>();
		if (componentjoint == null || componentjoint.isJointed)
			return false;
		if (isJointed)
			Separate();
		targetJoint = componentjoint;
		isJointed = true;
		componentjoint.SourceJoint = this;
		componentjoint.IsJointed = true;
		return true;
	}
Esempio n. 2
0
	//从TargetJoint上分离
	public void Separate() {
		if (targetJoint != null) {
			targetJoint.IsJointed = false;
			targetJoint.SourceJoint = null;
		}
		isJointed = false;
		targetJoint = null;
	}