예제 #1
0
 // OnTriggerEnter is called when the Collider other enters the trigger
 void OnTriggerEnter(Collider other)
 {
     // If the other collider is the player collect the pickup
     if (other.gameObject.tag == Tags.playerTag)
     {
         // Collect the key - remove minimap icon
         keyCollected = true;
         MiniMapController.RemoveMapObject(gameObject);
     }
 }
예제 #2
0
 // OnTriggerEnter is called when the Collider other enters the trigger
 void OnTriggerEnter(Collider other)
 {
     // If the other collider is the player collect the pickup
     if (other.gameObject.tag == Tags.playerTag)
     {
         // Collect the pickup - add points - remove minimap icon
         pickupCollected = true;
         other.gameObject.GetComponent <PlayerController>().AddToScore(points);
         MiniMapController.RemoveMapObject(gameObject);
     }
 }
예제 #3
0
 // OnTriggerEnter is called when the Collider other enters the trigger
 void OnTriggerEnter(Collider other)
 {
     // If the other collider is the player collect the pickup
     if (other.gameObject.tag == Tags.playerTag)
     {
         // Collect the pickup - add points - remove minimap icon
         healthCollected = true;
         other.gameObject.GetComponent <PlayerController>().AddToHealth(health);
         MiniMapController.RemoveMapObject(gameObject);
         GameDataManager.instance.HealthCollected(Index());
     }
 }
예제 #4
0
    // OnTriggerEnter is called when the Collider other enters the trigger
    void OnTriggerEnter(Collider other)
    {
        // If the other collider is the player
        if (other.gameObject.tag == Tags.playerTag)
        {
            // If the key has been collected
            if (keyCollected)
            {
                // Open the chest 
                chestOpened = true;
                anim.SetBool("Key", true);

                // Aadd points 
                other.gameObject.GetComponent<PlayerController>().AddToScore(points);

                // Remove minimap icon
                MiniMapController.RemoveMapObject(gameObject);
            }
            // Key not collected
            else if (!keyCollected && !chestOpened)
                anim.SetTrigger("NoKey");
        }
    }
예제 #5
0
 void OnDestroy()
 {
     MiniMapController.RemoveMapObject(this.gameObject);
 }
예제 #6
0
 // Update is called once per frame
 void OnDestroy()
 {
     //if the object is destroyed, Remove the object from the list
     //ex: items the generated by the spawners
     MiniMapController.RemoveMapObject(gameObject);
 }