void OnTriggerEnter(Collider other) { if (other.tag.Equals("Player")) { other.BroadcastMessage("ApplyDamage", DAMAGE); } }
void OnTriggerEnter(Collider player) { if (player.gameObject.tag == "Player") { player.BroadcastMessage("PortalExitCallback", true); } }
private void OnTriggerStay(Collider other) { if (Input.GetKeyDown("q") && other.gameObject.GetComponent <npcDialog>() != null) { other.BroadcastMessage("startTalk"); } }
void OnTriggerEnter(Collider other) { if (other.tag == "enemy"){ other.BroadcastMessage("hit", SendMessageOptions.DontRequireReceiver); Destroy(gameObject); } }
void OnTriggerEnter(Collider other) { if (other.tag == "enemy") { other.BroadcastMessage("hit", SendMessageOptions.DontRequireReceiver); Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { other.BroadcastMessage("PickupAmmo", rounds); Destroy(gameObject); } }
void OnTriggerEnter(Collider coll) { if (activated) { coll.BroadcastMessage("AAShot", SendMessageOptions.DontRequireReceiver); Destroy(gameObject); } }
void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Next") { Generador.OK = true; other.BroadcastMessage("Destruyete", SendMessageOptions.RequireReceiver); } }
/* public GameObject playerOne; public GameObject playerTwo; private IKillable playerOneKill; private IKillable playerTwoKill; //public LevelController Controller; void Start () { //Get the script of players that does the Killing playerOneKill = (IKillable)playerOne.GetComponent(typeof(IKillable)); playerTwoKill = (IKillable)playerTwo.GetComponent(typeof(IKillable)); } void Update () { } */ void OnTriggerEnter(Collider player) { if (player.gameObject.tag == "Player") { player.BroadcastMessage("KillPlayerCallback", player.transform.position); Player lets = player.gameObject.GetComponent<Player>(); lets.Kill(); } }
void OnTriggerStay(Collider other) { if (other.tag == "Entity" && Input.GetButtonDown("Jump") && grabbedObject == null) { print("GRAB"); other.BroadcastMessage("Grab", grabber); grabbedObject = other.gameObject; throwable = true; } }
protected void OnTriggerEnter(Collider col) { if (m_InteractTimer > 0) { return; } col.BroadcastMessage("OnProjectileInteraction", this, SendMessageOptions.DontRequireReceiver); m_InteractTimer = Interaction_Cooldown; }
void OnTriggerEnter(Collider other) { if(other.CompareTag("Player")) { if(!singleUse || (singleUse && !used)) { other.BroadcastMessage("StartDialogue", speakToIndex); if(singleUse) used = true; } } }
// Collision reaction void OnTriggerEnter(Collider pOther) { // We only hit other players if (pOther.gameObject.GetComponent <PlayerMovement>() == null) { return; } // Do Damage then explode! pOther.gameObject.GetComponent <Blink>().StartBlinking(1f, .05f); pOther.BroadcastMessage("TakeDamage"); Destroy(gameObject); }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { if (!singleUse || (singleUse && !used)) { other.BroadcastMessage("StartDialogue", speakToIndex); if (singleUse) { used = true; } } } }
void OnTriggerEnter(Collider other) { vel = rb.velocity.magnitude; if (vel > 1) { aSource.volume = vel / 40; if (aSource.enabled) { aSource.Play(); } if (other.CompareTag("Enemy") || other.CompareTag("Metal")) { other.BroadcastMessage("ApplyDamage", vel * 3000, SendMessageOptions.DontRequireReceiver); } } }
//If collides with something, destroy/respawn. Hit player? Apply damage void OnCollisionEnter(Collision collision) { Collider collider = collision.collider; if (gameObject.tag != "PausedProjectile" || collider.tag == "Platform") { //If collider is a player, apply damage if (collider.tag == "Player") { collider.BroadcastMessage("getDamage", dmgPackage); } //Set default characteristic slowed = false; rb.useGravity = true; gameObject.tag = "EnemyAttack"; //Respawn spike.position = spawnPoint; } }
void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "Player" && !triggered) { triggered = true; // Credits if (credits) { exhaustion.GetComponent<Exhaustion>().enabled = false; EventManager.inst.credits = true; col.BroadcastMessage("LoadCredits", true); endMemLerp.enabled = true; } // Checkpoint if (checkpoint) { EventManager.inst.currentCheckPoint = checkpointNo; } // Enemy if (enemyTrigger) { enemy.SetActive(true); } // End Level if (endLevel) { EventManager.inst.currentLevel = setLevel; EventManager.inst.currentCheckPoint = 0; if (loadScreenUI != null) { loadScreenUI.SetActive(true); } StartCoroutine("LoadNextScene"); } } }
void OnTriggerEnter(Collider other) { other.BroadcastMessage("onPickupActivated"); Destroy(gameObject); }
void OnTriggerEnter(Collider target) { target.BroadcastMessage("Turn", sendVec, SendMessageOptions.DontRequireReceiver); //Debug.Log(sendVec); }
// Update is called once per frame void OnTriggerEnter(Collider col) { col.BroadcastMessage("Damage", damageAmount, SendMessageOptions.DontRequireReceiver); }
void OnTriggerStay(Collider col) { if (col.gameObject.tag == "Player") { // Fog if (fogChange) { startFog = fog.heightDensity; fogLerp = 0; } } // Memory if (memory && memoryRetrigger <= 0 && !thisMemTriggered) { if (memoryEventNumber == EventManager.inst.currentMemory || memoryEventNumber <= 1) { EventManager.inst.subtitleNum = subtitleNum; EventManager.inst.memoryPlaying = true; dialogueAudio.clip = memoryDialogue; dialogueAudio.Play(); memoryDuration = memoryDialogue.length - endEarlyTimer; col.BroadcastMessage("EnterMemory", memoryDuration); col.BroadcastMessage("NightCheck", nightTime); col.BroadcastMessage("SetSwitch", switchObjects); col.BroadcastMessage("ExtraDim", extraDiminish); if (disableControls) { col.BroadcastMessage("DisableControls", true); } if (newBGM != null) { col.BroadcastMessage("SetBGM", newBGM); } if (memoryObj != null) { memoryObj.SetActive(true); startTimer = true; } Invoke("DelayedMemoryPlaying", 2f); memoryRetrigger = 1f; } } if (!EventManager.inst.memoryPlaying) { memoryRetrigger -= Time.deltaTime; } else { thisMemTriggered = true; } }
void OnTriggerEnter(Collider other) { other.BroadcastMessage("Hit", -damage,SendMessageOptions.DontRequireReceiver); owner.RaiseAttackLanded(owner.attackIndex); Destroy(this.gameObject); }
private void OnTriggerEnter(Collider other) { other.BroadcastMessage("Kill", null, SendMessageOptions.DontRequireReceiver); aSource.Play(); }