Пример #1
0
    // for when the bullet hits something
    void OnCollisionEnter2D(Collision2D coll)
    {
        DrillController drillController = drill.GetComponent <DrillController>();

        //If the target is an enemy, take health off them
        if (coll.gameObject.tag == "Enemy")
        {
            script = coll.gameObject.GetComponent <EnemyController2D>();
            script.DealLaserDamage(1 * drillController.turretDamage);
        }
        this.gameObject.SetActive(false);

        //Reset the timer for the bullet being reset
        scriptTimer = timerReset.GetComponent <TurretFiring>();
        scriptTimer.ResetTimer();
    }
Пример #2
0
    private void Start()
    {
        _cannonFiring   = Cannon.GetComponent <TurretFiring>();
        _playerMovement = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>();

        if (_playerMovement == null)
        {
            Debug.LogError("Player is not founded");
        }

        _shaker = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraShake>();

        _curTacticCooldown = SwitchTacticCooldown;
        _particles         = GetComponent <ParticleSystem>();
        UpgradeTime        = 3f;
        _curTactic         = Random.Range(0, 3);
    }
Пример #3
0
    private void Start()
    {
        _cannonFiring = Cannon.GetComponent<TurretFiring>();
        _playerMovement = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMovement>();

        if (_playerMovement == null){
            Debug.LogError("Player is not founded");
        }

        _shaker = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraShake>();

        _curTacticCooldown = SwitchTacticCooldown;
        _particles = GetComponent<ParticleSystem>();
        UpgradeTime = 3f;
        _curTactic = Random.Range(0, 3);
    }