コード例 #1
0
 private void Start()
 {
     cameraShake   = Camera.main.GetComponent <CameraShake>();
     _enemyScript  = GetComponent <EnemyControls>();
     _playerScript = GetComponent <PlayerLife>();
     ShootingMode();
 }
コード例 #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();
    }
コード例 #3
0
ファイル: LaserBeam.cs プロジェクト: Jaype27/TheWall
    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);
        }
    }
コード例 #4
0
 // 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;
     }
 }