Exemplo n.º 1
0
Arquivo: Weapon.cs Projeto: Hooch0/FPS
    public void Interact(ICharacter character)
    {
        _character = character;

        ChangeGraphicsLayerMask(0x8);

        transform.parent        = _character.ArmsInformation.ArmsHolder.transform;
        transform.localPosition = Vector3.zero;
        transform.localRotation = Quaternion.identity;


        foreach (Collider collider in WeaponColliders)
        {
            collider.enabled = false;
        }
        WeaponRigidbody.collisionDetectionMode = CollisionDetectionMode.Discrete;
        WeaponRigidbody.isKinematic            = true;
        WeaponRigidbody.useGravity             = false;

        InteractableGO.layer = 0x0;
        WeaponRecoil.SetRecoilTarget(_character);
        character.InventorySystem.EquipWeapon(this);
    }