public void OnChildTriggerEnter(TriggerForwarder child, Collider c, IMovableSnappable res) { ResourceComponent resComp = res.transform.GetComponent <ResourceComponent>(); if (resComp != null) { if (resComp.Data.Container.MatterType.Is3DPrinterFeedstock()) { if (child == leftInputTrigger && LeftInput == null) { LeftInput = resComp; res.SnapCrate(this, child.transform.position, globalRotation: child.transform.rotation); } else if (child == rightInputTrigger && RightInput == null) { RightInput = resComp; res.SnapCrate(this, child.transform.position, globalRotation: child.transform.rotation); } } else { GuiBridge.Instance.ShowNews(NewsSource.InvalidSnap); } } }
public void OnChildTriggerEnter(TriggerForwarder child, Collider c, IMovableSnappable res) { if (c.transform == CurrentMinilab && detachTimer == null) { MinilabDocked = true; res.SnapCrate(this, MinilabSnap.position); } }
public void OnChildTriggerEnter(TriggerForwarder child, Collider c, IMovableSnappable movesnap) { if (unsnapTimer == null) { var cube = movesnap.transform.GetComponent <PowerCube>(); if (cube != null) { movesnap.SnapCrate(this, child.transform.position, globalRotation: child.transform.rotation); BalanceAddNew(cube, child.transform.GetSiblingIndex()); } } }
public void OnChildTriggerEnter(TriggerForwarder child, Collider c, IMovableSnappable res) { ResourceComponent oreBucket = res.transform.GetComponent <ResourceComponent>(); if (oreBucket != null && oreOut == null && attachedDeposit != null && oreBucket.Data.Container.MatterType.IsRawMaterial() && matches(oreBucket.Data.Container.MatterType, attachedDeposit.Data.Extractable.MatterType)) { oreOut = oreBucket; if (oreBucket.Data.Container.MatterType == Matter.Unspecified) { oreBucket.Data.Container.MatterType = attachedDeposit.Data.Extractable.MatterType; } res.SnapCrate(this, child.transform.position); } }
private void SnapToLatch(TriggerForwarder child, IMovableSnappable res, float offset) { res.SnapCrate(this, child.transform.position + child.transform.TransformDirection(new Vector3(0, 0, -offset)), carRigid); }