public void Fix() { ruby.PlaySound(gotHit); rigidbody2d.simulated = false; animator.SetTrigger("Fixed"); smokeEffect.Stop(); ruby.PlaySound(gotFixed); ruby.RepairProgress(); }
private void OnCollisionEnter2D(Collision2D other) { RubyController player = other.gameObject.GetComponent <RubyController>(); if (player != null) { player.ChangeHealth(-1); playerController.PlaySound(healthDamageSound); } }
// collission checker private void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); RubyPlatformerControl controller2 = other.GetComponent <RubyPlatformerControl>(); if (controller != null) { if (controller.health < controller.maxHealth) { // breytir health, eyðir objectinu, synir effect og spilar hljoðið controller.ChangeHealth(1); Destroy(gameObject); HealthCollisionEffect = Instantiate(HealthEffect, transform.position, Quaternion.identity) as ParticleSystem; HealthCollisionEffect.Play(); controller.PlaySound(collectedClip); } } if (controller2 != null) { if (controller2.health < controller2.maxHealth) { // breytir health, eyðir objectinu, synir effect og spilar hljoðið controller2.ChangeHealth(1); Destroy(gameObject); HealthCollisionEffect = Instantiate(HealthEffect, transform.position, Quaternion.identity) as ParticleSystem; HealthCollisionEffect.Play(); controller2.PlaySound(collectedClip); } } }
public void DeliverItem(bool hasKey) { ruby.PlaySound(satanShoot); if (hasKey) { ruby.ToggleSword(); } }
public void Fix() { broken = false; audioSource.Stop(); controller.PlaySound(fixedClip); rigidbody2D.simulated = false; animator.SetTrigger("Fixed"); smokeEffect.Stop(); }
void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); if (controller != null) { controller.PlaySound(collectedClip); } }
public void Launch(Vector2 direction, float force, AudioSource audiosource) { RubyController controller = GetComponent <RubyController>(); controller = audiosource.GetComponent <RubyController>(); controller.PlaySound(throwCog); this.rigidbody2d.AddForce(direction * force); }
// Start is called before the first frame update private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Player") { ruby.PlaySound(collectSoundClip); gameController.GetComponent <ZezeController>().collectedCrystal += 1; gameController.GetComponent <ZezeController>().getCrystal(); Destroy(gameObject); } }
// Start is called before the first frame update void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); if (controller != null && controller.ChangeHealth(1, false)) { Destroy(gameObject); controller.PlaySound(collectedClip); } }
void OnTriggerStay2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); if (controller != null) { controller.ChangeHealth(-1); controller.PlaySound(hitFromDamageZoneClip); } }
private void OnCollisionEnter2D(Collision2D collision) { RubyController player = collision.gameObject.GetComponent <RubyController>(); if (player) { player.ChangeHealth(enemyDamage); player.PlaySound(PickRandomSound()); } }
void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); if (controller != null) { controller.ChangeHeath(-1); controller.PlaySound(damageClip); } }
void OnCollisionEnter2D(Collision2D other) { RubyController player = other.gameObject.GetComponent <RubyController> (); if (player != null) { player.ChangeHealth(-1); player.PlaySound(collectedClip); } }
// Start is called before the first frame update private void OnTriggerEnter2D(Collider2D collision) { RubyController controller = collision.GetComponent <RubyController>(); if (controller != null && controller.health < controller.maxHealth) { controller.ChangeHealth(1); Destroy(gameObject); controller.PlaySound(collectedClip); } }
void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController> (); if (controller != null) { controller.AddCogs(); controller.PlaySound(collectedClip); Destroy(gameObject); } }
void OnCollisionEnter2D(Collision2D other) { RubyController rc = other.gameObject.GetComponent <RubyController>(); if (rc != null) { rc.changeHealth(-1); rc.PlaySound(collectedClip); } //if }
void OnTriggerEnter2D(Collider2D other) { //Debug.Log("Object that entered the trigger :"+ other); RubyController controller = other.GetComponent <RubyController>(); if (controller != null) { controller.ChangeHealth(-1); controller.PlaySound(hitClip); } }
// Checks if collision occured with player and damages player if true void OnCollisionEnter2D(Collision2D other) { RubyController player = other.gameObject.GetComponent <RubyController>(); Animator playerAnimator = other.gameObject.GetComponent <Animator>(); if (player != null) { if (player.getInvincible()) { return; } int index = Random.Range(0, hit.Length); player.ChangeHealth(-1); hitEffect.Play(); playerAnimator.SetTrigger("Hit"); botHit = hit[index]; player.PlaySound(botHit); player.PlaySound(playerHit); } }
void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); // CONTROLLER == RUBY Debug.Log("here"); if (controller != null) { Debug.Log("passed"); controller.PlaySound(ChangeLevelClip); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); } }
void OnTriggerEnter2D(Collider2D collision) { RubyController controller = collision.GetComponent <RubyController>(); if (controller != null) { controller.AddAmmo(11); Destroy(gameObject); controller.PlaySound(collectedClip); } }
void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); if (controller != null && controller.health < controller.maxHealth) { controller.ChangeHealth(1); Instantiate(collectionEffect, gameObject.transform.position, Quaternion.identity); Destroy(gameObject); controller.PlaySound(collectedClip); } }
void OnTriggerEnter2D(Collider2D other) { RubyController rubyCtrl = other.GetComponent <RubyController>(); if (rubyCtrl != null && rubyCtrl.ChangeHealth(HP)) { rubyCtrl.invincibleTimer = 3; Destroy(gameObject); rubyCtrl.PlaySound(collectedClip); Debug.Log("Object that entered the trigger : " + rubyCtrl.gameObject); } }
void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); if ((controller != null) && (controller.CurrentHealth < controller.maxHealth)) { Instantiate(pickupEffect); controller.ChangeHealth(amount); controller.PlaySound(collectedClip); Destroy(gameObject); } }
void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); if (controller != null) { controller.increaseAmmo(); controller.setAmmoText(); Destroy(gameObject); controller.PlaySound(cogCollectedAudio); } }
void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); if (controller != null) { Destroy(gameObject); controller.PlaySound(bambiCollectedAudio); NonPlayerCharacter.hasFrog = true; } }
private void OnTriggerEnter2D(Collider2D other) { RubyController rubyController = other.GetComponent <RubyController>(); if (rubyController != null && rubyController.Health < rubyController.maxHealth) { rubyController.ChangeHealth(1); Instantiate(collectibleEffect, transform.position, Quaternion.identity); Destroy(gameObject); rubyController.PlaySound(collectedClip); } }
void OnTriggerEnter2D(Collider2D other) { RubyController controller = other.GetComponent <RubyController>(); if (controller != null) { if (controller.health < controller.maxHealth) { controller.ChangeHealth(1); Destroy(gameObject); controller.PlaySound(collectedClip); } } }
void OnTriggerEnter2D(Collider2D other) { RubyController rubyController = other.GetComponent <RubyController>(); if (rubyController != null) { if (rubyController.Lövedék < rubyController.maxLövedék) { rubyController.ChangeAmmo(LövedékDB); Destroy(gameObject); rubyController.PlaySound(collectedClip); } } }
private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "player") { RubyController rubyController = other.GetComponent <RubyController>(); if (rubyController.GetCurHp() < rubyController.m_fMaxHp) { rubyController.ChangeHp(1); rubyController.PlaySound(m_acPickUp); Instantiate(m_effectPickUp, transform.position, Quaternion.identity); Destroy(gameObject); } } }
void OnTriggerEnter2D(Collider2D iOther) { RubyController gController = iOther.GetComponent <RubyController>(); if (gController != null) { if (gController.gHealth < gController.cMaxHealth) { gController.ChangeHealth(1); Destroy(gameObject); gController.PlaySound(gCollectedClip); } } }