Ejemplo n.º 1
0
    public void Awake()
    {
        HardpointMaster component = base.idMain.GetComponent <HardpointMaster>();

        if (component != null)
        {
            this.SetMaster(component);
        }
        base.Awake();
    }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
 public void SetMaster(HardpointMaster master)
 {
     this._master = master;
     master.AddHardpoint(this);
 }
Ejemplo n.º 5
0
 public void SetMaster(HardpointMaster master)
 {
     this._master = master;
     master.AddHardpoint(this);
 }