Esempio n. 1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player"))
     {
         other.BroadcastMessage("ApplyDamage", DAMAGE);
     }
 }
Esempio n. 2
0
 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");
     }
 }
Esempio n. 4
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "enemy"){
         other.BroadcastMessage("hit", SendMessageOptions.DontRequireReceiver);
         Destroy(gameObject);
     }
 }
Esempio n. 5
0
 void  OnTriggerEnter(Collider other)
 {
     if (other.tag == "enemy")
     {
         other.BroadcastMessage("hit", SendMessageOptions.DontRequireReceiver);
         Destroy(gameObject);
     }
 }
Esempio n. 6
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         other.BroadcastMessage("PickupAmmo", rounds);
         Destroy(gameObject);
     }
 }
Esempio n. 7
0
 void OnTriggerEnter(Collider coll)
 {
     if (activated)
     {
         coll.BroadcastMessage("AAShot", SendMessageOptions.DontRequireReceiver);
         Destroy(gameObject);
     }
 }
Esempio n. 8
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Next")
     {
         Generador.OK = true;
         other.BroadcastMessage("Destruyete", SendMessageOptions.RequireReceiver);
     }
 }
Esempio n. 9
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Next")
     {
         Generador.OK = true;
         other.BroadcastMessage("Destruyete", SendMessageOptions.RequireReceiver);
     }
 }
Esempio n. 10
0
 void OnTriggerEnter(Collider coll)
 {
     if (activated)
     {
         coll.BroadcastMessage("AAShot", SendMessageOptions.DontRequireReceiver);
         Destroy(gameObject);
     }
 }
Esempio n. 11
0
    /*
    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();
        }
    }
Esempio n. 12
0
 void OnTriggerStay(Collider other)
 {
     if (other.tag == "Entity" && Input.GetButtonDown("Jump") && grabbedObject == null) {
         print("GRAB");
         other.BroadcastMessage("Grab", grabber);
         grabbedObject = other.gameObject;
         throwable = true;
     }
 }
Esempio n. 13
0
    protected void OnTriggerEnter(Collider col)
    {
        if (m_InteractTimer > 0)
        {
            return;
        }

        col.BroadcastMessage("OnProjectileInteraction", this, SendMessageOptions.DontRequireReceiver);

        m_InteractTimer = Interaction_Cooldown;
    }
Esempio n. 14
0
 void OnTriggerEnter(Collider other)
 {
     if(other.CompareTag("Player"))
     {
         if(!singleUse || (singleUse && !used))
         {
             other.BroadcastMessage("StartDialogue", speakToIndex);
             if(singleUse)
                 used = true;
         }
     }
 }
Esempio n. 15
0
    // 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);
    }
Esempio n. 16
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         if (!singleUse || (singleUse && !used))
         {
             other.BroadcastMessage("StartDialogue", speakToIndex);
             if (singleUse)
             {
                 used = true;
             }
         }
     }
 }
Esempio n. 17
0
 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);
         }
     }
 }
Esempio n. 18
0
    //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;
        }
    }
Esempio n. 19
0
    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");
            }

        }
    }
Esempio n. 20
0
 void OnTriggerEnter(Collider other)
 {
     other.BroadcastMessage("onPickupActivated");
     Destroy(gameObject);
 }
 void OnTriggerEnter(Collider target)
 {
     target.BroadcastMessage("Turn", sendVec, SendMessageOptions.DontRequireReceiver);
     //Debug.Log(sendVec);
 }
Esempio n. 22
0
 // Update is called once per frame
 void OnTriggerEnter(Collider col)
 {
     col.BroadcastMessage("Damage", damageAmount, SendMessageOptions.DontRequireReceiver);
 }
Esempio n. 23
0
    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;
        }
    }
Esempio n. 24
0
 void OnTriggerEnter(Collider other)
 {
     other.BroadcastMessage("Hit", -damage,SendMessageOptions.DontRequireReceiver);
     owner.RaiseAttackLanded(owner.attackIndex);
     Destroy(this.gameObject);
 }
Esempio n. 25
0
 private void OnTriggerEnter(Collider other)
 {
     other.BroadcastMessage("Kill", null, SendMessageOptions.DontRequireReceiver);
     aSource.Play();
 }