public void Awake() { HardpointMaster component = base.idMain.GetComponent <HardpointMaster>(); if (component != null) { this.SetMaster(component); } base.Awake(); }
public static Hardpoint GetHardpointFromRay(Ray ray, Hardpoint.hardpoint_type type) { RaycastHit raycastHit; bool flag; MeshBatchInstance meshBatchInstance; if (Facepunch.MeshBatch.MeshBatchPhysics.Raycast(ray, out raycastHit, 10f, out flag, out meshBatchInstance)) { IDMain dMain = (!flag ? IDBase.GetMain(raycastHit.collider) : meshBatchInstance.idMain); if (dMain) { HardpointMaster component = dMain.GetComponent <HardpointMaster>(); if (component) { return(component.GetHardpointNear(raycastHit.point, type)); } } } return(null); }
public static Hardpoint GetHardpointFromRay(Ray ray, hardpoint_type type) { RaycastHit hit; bool flag; MeshBatchInstance instance; if (Facepunch.MeshBatch.MeshBatchPhysics.Raycast(ray, out hit, 10f, out flag, out instance)) { IDMain main = !flag?IDBase.GetMain(hit.collider) : instance.idMain; if (main != null) { HardpointMaster component = main.GetComponent <HardpointMaster>(); if (component != null) { return(component.GetHardpointNear(hit.point, type)); } } } return(null); }
public void SetMaster(HardpointMaster master) { this._master = master; master.AddHardpoint(this); }