public void RestoreState(object state) { string weaponName = (string)state; WeaponConfig weapon = UnityEngine.Resources.Load <WeaponConfig>(weaponName); EquipWeapon(weapon); }
private Weapon AttachWeapon(WeaponConfig weapon) { Animator animator = GetComponent <Animator>(); return(weapon.Spawn(rightHandTransform, leftHandTransform, animator)); }
public void EquipWeapon(WeaponConfig weapon) { currentWeaponConfig = weapon; currentWeapon.value = AttachWeapon(weapon); }
private void Awake() { currentWeaponConfig = defaultWeapon; currentWeapon = new LazyValue <Weapon>(SetupDefaultWeapon); }