Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class EquipmentSystem : MonoBehaviour
- {
- [SerializeField] GameObject weaponHolder;
- [SerializeField] GameObject weapon;
- [SerializeField] GameObject weaponSheath;
- GameObject currentWeaponInHand;
- GameObject currentWeaponInSheath;
- void Start()
- {
- currentWeaponInSheath = Instantiate(weapon, weaponSheath.transform);
- }
- public void DrawWeapon()
- {
- currentWeaponInHand = Instantiate(weapon, weaponHolder.transform);
- Destroy(currentWeaponInSheath);
- }
- public void SheathWeapon()
- {
- currentWeaponInSheath = Instantiate(weapon, weaponSheath.transform);
- Destroy(currentWeaponInHand);
- }
- public void StartDealDamage()
- {
- currentWeaponInHand.GetComponentInChildren<DamageDealer>().StartDealDamage();
- }
- public void EndDealDamage()
- {
- currentWeaponInHand.GetComponentInChildren<DamageDealer>().EndDealDamage();
- }
- }
Add Comment
Please, Sign In to add comment