Esempio n. 1
0
        private IEnumerator FireCooldown(float fireRate, ViewUiWeaponItem item)
        {
            var endTime = Time.time + fireRate;

            while (endTime > Time.time)
            {
                item.ImageCooldown.fillAmount = 1f - (endTime - Time.time) / fireRate;
                yield return(null);
            }
            item.ImageCooldown.fillAmount = 0f;
        }
Esempio n. 2
0
        private void OnPlayerCreated(Entity player)
        {
            _weapons = player.getComponent <WeaponsComponent>();

            foreach (var weapon in _weapons.Weapons)
            {
                AddWeapon(weapon.Type);
            }

            _currentWeaponItem = GetItemByWeaponType(_weapons.CurrentWeaponView.Type);
            MarkSelect(_currentWeaponItem, true);
        }
Esempio n. 3
0
 private void OnWeaponSwitch(EWeaponType weaponType)
 {
     MarkSelect(_currentWeaponItem, false);
     _currentWeaponItem = GetItemByWeaponType(weaponType);
     MarkSelect(_currentWeaponItem, true);
 }
Esempio n. 4
0
 private void MarkSelect(ViewUiWeaponItem item, bool value)
 {
     item.SelectedBackGround.gameObject.SetActive(value);
 }