Beispiel #1
0
    private void ProcessTrigger(Collider2D collider2D, bool enter)
    {
        Submergable submergable = collider2D.gameObject.GetComponent <Submergable>();

        if (submergable != null)
        {
            submergable.Submerge(enter);
        }
    }
Beispiel #2
0
 // Initialization / Setup
 /// <summary>
 /// Initializes the biped object, obtians all relevant components.
 /// </summary>
 private void Initialize()
 {
     // Set our layer, obtain appropriate components.
     this.gameObject.layer = Globals.BIPED_LAYER;
     _submergable          = this.GetComponent <Submergable>();
     _rigidbody2D          = this.GetComponent <Rigidbody2D>();
     _boxCollider2D        = this.GetComponent <BoxCollider2D>();
     _spriteRenderer       = this.GetComponent <SpriteRenderer>();
     _collisionList        = this.GetComponent <CollisionList>();
 }