Пример #1
0
    private void Start()
    {
        _player = GameObject.Find("PlayerHans");
        if (_player)
        {
            _characterMovement  = _player.GetComponent <CharacterMovement>();
            _gunFiring          = _player.GetComponentInChildren <GunFiring>();
            _playerHealthScript = _player.GetComponent <HealthScript>();

            playerHealthMax = _playerHealthScript.totalHealth;

            if (speedBar)
            {
                speedBar.fillAmount = _characterMovement.speed / speedMax;
            }
            if (damageBar)
            {
                damageBar.fillAmount = (float)_gunFiring.damageOfWeapon / damageMax;
            }
            if (projectileSpeedBar)
            {
                projectileSpeedBar.fillAmount = _gunFiring.projectileSpeedOfWeapon / projectileSpeedMax;
            }
            if (playerHealthBar)
            {
                playerHealthBar.fillAmount = (float)_playerHealthScript.currentHealth / playerHealthMax;
            }
        }

        guiUpgrade.gameObject.SetActive(false);
        _manageSurvivalRounds = GetComponent <ManageSurvivalRounds>();
    }
Пример #2
0
 public void Firing()
 {
     GunFiring.Invoke(this, _args);
 }
Пример #3
0
 public void Start()
 {
     _player          = GameObject.Find("PlayerHans");
     _gunFiringScript = enemyGun.GetComponent <GunFiring>();
 }
Пример #4
0
 public void Start()
 {
     _mainCamera      = FindObjectOfType <Camera>();
     _gunFiringScript = playerGun.GetComponent <GunFiring>();
 }