コード例 #1
0
        void Awake()
        {
            _animator   = GetComponent <PlayerAnimator>();
            _inventory  = GetComponentInChildren <PlayerInventory>();
            _flashlight = GetComponentInChildren <PlayerFlashlight>();
            _weaponSlot = GetComponentInChildren <PlayerWeaponSlot>();

            _playerStatus.isWalking = true;
        }
コード例 #2
0
        private void Awake()
        {
            _weaponSlot  = transform.root.GetComponentInChildren <PlayerWeaponSlot>();
            _grenadeSlot = transform.root.GetComponentInChildren <PlayerGrenadeSlot>();
            _flashlight  = transform.root.GetComponentInChildren <PlayerFlashlight>();

            _weaponSlot.OnWeaponAttack.AddListener(UpdateAmmoHUD);
            _grenadeSlot.OnGrenadeChanged.AddListener(UpdateGrenadeHUD);
        }
コード例 #3
0
        void Awake()
        {
            _animator       = GetComponent <Animator>();
            _playerAudio    = GetComponent <PlayerAudioPlayer>();
            _charController = GetComponent <CharacterController>();
            _ragdoll        = GetComponentsInChildren <Rigidbody>();

            foreach (Rigidbody rb in _ragdoll)
            {
                rb.isKinematic = true;
            }

            _weaponSlot   = GetComponentInChildren <PlayerWeaponSlot>();
            _grenadeSlot  = GetComponentInChildren <PlayerGrenadeSlot>();
            _playerStatus = GetComponent <PlayerCharacter>().PlayerStatus;

            _adjustmentParts.weaponSlot = _weaponSlot.transform;
            _currentSpineAdjustment     = _postureAdjustment.spineHipAdjustment;

            _weaponSlot.OnWeaponAnimationChanged.AddListener(ChangeWeaponAnimationGroup);

            animationStatus.isHoldingNothing = true;
        }