public bool CanTransferTo(PackedVessel vsl, HangarPassage other, PassageNode requesting_node = null) { if (!enabled) { return(false); } if (this == other) { return(CanHold(vsl)); } var this_node = requesting_node?.OtherNode; bool can_transfer = false; foreach (var pn in Nodes.Values) { if (pn == this_node) { continue; } var other_passage = pn.CanPassThrough(vsl); if (other_passage != null) { can_transfer = other_passage.CanTransferTo(vsl, other, pn); } if (can_transfer) { break; } } return(can_transfer); }
public override void OnStart(StartState state) { base.OnStart(state); entrance = part.GetPassage(); if (entrance == null) { return; } passage_checklist = part.AllModulesOfType <HangarPassage>(); StartCoroutine(delayed_update_state()); }
void get_part_components() { passage = part.Modules.GetModule <HangarPassage>(); try { //get transforms and meshes Transform bodyT = part.FindModelTransform(BodyName); if (bodyT == null) { this.Log("'{}' transform does not exists in the {1}", BodyName, part.name); } Transform colliderT = part.FindModelTransform(ColliderName); if (colliderT == null) { this.Log("'{}' transform does not exists in the {1}", ColliderName, part.name); } //The mesh method unshares any shared meshes MeshFilter body_mesh_filter = bodyT.GetComponent <MeshFilter>(); if (body_mesh_filter == null) { this.Log("'{}' does not have MeshFilter component", BodyName); } body_mesh = body_mesh_filter.mesh; body_collider = colliderT.GetComponent <MeshCollider>(); if (body_collider == null) { this.Log("'{}' does not have MeshCollider component", ColliderName); } } catch (Exception ex) { Debug.LogException(ex); isEnabled = enabled = false; } }
protected override void early_setup(StartState state) { base.early_setup(state); entrance = part.GetPassage(); }