示例#1
0
    public bool AttachHeavyObject(HeavyObject ho)
    {
        if (!ho)
        {
            return(false);
        }
        Transform transform = this.FindFreeSlot();

        if (transform)
        {
            HeavyObject x = null;
            if (!this.m_Attached.TryGetValue(transform, out x) || x == null)
            {
                Physics.IgnoreCollision(Player.Get().m_Collider, ho.m_Collider, true);
                ho.transform.position          = transform.position;
                ho.transform.rotation          = transform.rotation;
                ho.gameObject.transform.parent = transform;
                transform.gameObject.tag       = this.m_AttachTag;
                this.m_Attached[transform]     = ho;
                ho.OnItemAttachedToHand();
                PlayerConditionModule.Get().GetDirtinessAdd(GetDirtyReason.HeavyObject, (HeavyObjectInfo)ho.m_Info);
                this.UpdatePhx();
                return(true);
            }
        }
        return(false);
    }
示例#2
0
    public void AttachHeavyObject(HeavyObject ho)
    {
        if (!ho)
        {
            return;
        }
        Transform transform = this.FindFreeSlot();

        if (transform)
        {
            HeavyObject x = null;
            if (!this.m_Attached.TryGetValue(transform, out x) || x == null)
            {
                Physics.IgnoreCollision(Player.Get().GetComponent <Collider>(), ho.GetComponent <Collider>(), true);
                ho.transform.position          = transform.position;
                ho.transform.rotation          = transform.rotation;
                ho.gameObject.transform.parent = transform;
                this.m_Attached[transform]     = ho;
                ho.OnItemAttachedToHand();
            }
        }
    }