コード例 #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (TagList.ContainsTag(other.gameObject, Constants.TAG_PLAYER))
     {
         _gameState.CompleteLevel();
     }
 }
コード例 #2
0
 /**
  *
  * COLLISIONS
  *
  */
 void OnCollisionExit(Collision collision)
 {
     if (TagList.ContainsTag(collision.gameObject, Constants.TAG_BOX))
     {
         IsPushingBoxInX = false;
         IsPushingBoxInZ = false;
     }
 }
コード例 #3
0
 private void OnTriggerExit(Collider other)
 {
     if (TagList.ContainsTag(other.gameObject, Constants.TAG_BUTTON_PUSHER))
     {
         _numberofPressingObjects--;
         UnpushButton();
     }
 }
コード例 #4
0
 private void OnTriggerEnter(Collider other)
 {
     // Targets with the "Burnable" tag must implement Burn.
     // Currently only works with the Player
     if (TagList.ContainsTag(other.gameObject, Constants.TAG_BURNABLE))
     {
         other.GetComponent <PlayerController>().Burn();
     }
 }
コード例 #5
0
    private void OnTriggerEnter(Collider other)
    {
        if (TagList.ContainsTag(other.gameObject, Constants.TAG_PLAYER))
        {
            // Addition - Add the value to the player's current energy
            if (PickupEffect.Equals(Constants.PICKUP_ADDITION))
            {
                PlayerController playerController = other.gameObject.GetComponent <PlayerController>();
                playerController.Energy += Value;
                Destroy(this.gameObject);
            }

            // Insert additional effects here
        }
    }
コード例 #6
0
 private bool IsCollidingWithPlayer(Collision collision)
 {
     return(TagList.ContainsTag(collision.gameObject, Constants.TAG_ENEMY));
 }
コード例 #7
0
ファイル: TagList.cs プロジェクト: BeljunWaffel/SpringPig3D
    public static bool ContainsTag(GameObject gameObject, string tag)
    {
        TagList tags = gameObject.GetComponent <TagList>();

        return(tags != null && tags.ContainsTag(tag));
    }