Ejemplo n.º 1
0
    void Start()
    {
        gunSlot = FindObjectOfType <SwitchingWeapon>();
        gunSlot.WeaponHaveSwitched.AddListener(WeaponSwitching);

        if (gunSlot != null)
        {
            weaponDataBase = gunSlot.GetComponentInChildren <WeaponDataBase>();
        }

        shootMecanics = gunSlot.GetComponentInChildren <ShootMecanics>();
        shootMecanics.BulletShot.AddListener(BulletShot);
        shootMecanics.ReloadGun.AddListener(ReloadGun);
    }
Ejemplo n.º 2
0
    void Awake()
    {
        gunSlot = FindObjectOfType <SwitchingWeapon>();

        gunSlot.WeaponHaveSwitched.AddListener(WeaponSwitching);

        if (gunSlot != null)
        {
            weaponDataBase = gunSlot.GetComponentInChildren <WeaponDataBase>();
        }
    }