private void Start()
 {
     cameraShake   = Camera.main.GetComponent <CameraShake>();
     _enemyScript  = GetComponent <EnemyControls>();
     _playerScript = GetComponent <PlayerLife>();
     ShootingMode();
 }
Exemple #2
0
    void Start()
    {
        player           = FindObjectOfType <PlayerControls>();
        enemy            = FindObjectOfType <EnemyControls>();
        projectileScript = FindObjectOfType <ProjectileScript>();
        countdown        = FindObjectOfType <Text>();

        beatCooldown     = 60 / BPM;
        beatCooldownLeft = 0f;
        laneToMove       = 2;
        beat             = 0;

        totalTime = 0f;

        reset();
    }
Exemple #3
0
    void OnTriggerEnter2D(Collider2D other)
    {
        EnemyControls _enemy = other.GetComponent <EnemyControls>();


        if (other.gameObject.tag == "enemy")
        {
            _enemy.TakeDamage(_damage);

            this.gameObject.SetActive(false);
        }

        if (other.gameObject.tag == "wall")
        {
            this.gameObject.SetActive(false);
        }
    }
 // Use this for initialization
 void Start()
 {
     enemy = GameObject.Find ("Enemy").GetComponent<EnemyControls>();
     curPerc = 0f;
     targetPerc = 1f;
     CanFadeIn = false;
     alpha = 0f;
     fadeSwitch = true;
     canEmit = true;
     foreach (ParticleSystem p in damageParticles)
     {
         p.enableEmission = false;
     }
 }