Esempio n. 1
0
        public void RestoreState(object state)
        {
            string       weaponName = (string)state;
            WeaponConfig weapon     = UnityEngine.Resources.Load <WeaponConfig>(weaponName);

            EquipWeapon(weapon);
        }
Esempio n. 2
0
        private Weapon AttachWeapon(WeaponConfig weapon)
        {
            Animator animator = GetComponent <Animator>();

            return(weapon.Spawn(rightHandTransform, leftHandTransform, animator));
        }
Esempio n. 3
0
 public void EquipWeapon(WeaponConfig weapon)
 {
     currentWeaponConfig = weapon;
     currentWeapon.value = AttachWeapon(weapon);
 }
Esempio n. 4
0
 private void Awake()
 {
     currentWeaponConfig = defaultWeapon;
     currentWeapon       = new LazyValue <Weapon>(SetupDefaultWeapon);
 }