public void Abort() { lock (jointLock) { if (joint != null) { DestroyImmediate(joint); } } if (hookAnchor != null) { ReleaseHookAnchor(); return; } if (Target != null) { Target.Die(); } Target = null; if (localAnchor != null) { if (localAnchorJoint != null) { DestroyImmediate(localAnchorJoint); } Destroy(localAnchor); } }
public void PlaceHook(Part newSpawnedPart) { ActiveStrutsAddon.Mode = AddonMode.None; var module = _getModuleFromPart(newSpawnedPart); if (module == null) { //submit for removal ActiveStrutsAddon.NewSpawnedPart = newSpawnedPart; return; } MaxDistance = -1f; Target = module; _createLocalAnchor(); StartCoroutine(WaitAndCreateJoint()); }