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

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

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