예제 #1
0
    private void EquipWeapon(Weapon newWeapon)
    {
        ClearWeapon();

        CurrentWeapon = newWeapon;
        CurrentModel  = Instantiate(newWeapon.model, weaponParent.position, weaponParent.rotation, weaponParent);

        if (isLocalPlayer)
        {
            CurrentModel.GetComponent <Renderer>().shadowCastingMode = ShadowCastingMode.ShadowsOnly;
            CurrentModel = Instantiate(newWeapon.model, viewmodelWeaponParent.position, viewmodelWeaponParent.rotation, viewmodelWeaponParent);
            Utility.SetLayerRecursively(CurrentModel.gameObject, LayersManager.ViewmodelLayer);
        }
    }