private Weapon AttachWeapon(WeaponConfig weapon)
        {
            Animator animator = GetComponent <Animator>();

            //weapon scriptableObject icinden gelen method
            return(weapon.Spawn(rightHandTransform, leftHandTransform, animator));
        }
        public void RestoreState(object state)
        {
            string       weaponName = (string)state;
            WeaponConfig weapon     = UnityEngine.Resources.Load <WeaponConfig>(weaponName);

            EquipWeapon(weapon);
        }
 private void Awake()
 {
     _currentWeaponConfig = defaultWeapon;
     _currentWeapon       = new LazyValue <Weapon>(InitialWeapon);
 }
 //bu method oyun icinde silah gordumuzde o silahi almamiza yariyan method'dur
 public void EquipWeapon(WeaponConfig weapon)
 {
     _currentWeaponConfig = weapon;
     //weaponOverride bizim AnimatorAnimatorController'imizdir ve kilic icin olusuturdumuz bir aniOverrideController'dir bu su isi yapmakta normal animasyonu bos elle yumruk atam ani gibi onu controller icinde ezip kilicla vurma anisine cevirme isi yapar
     _currentWeapon.Value = AttachWeapon(weapon);
 }