private void OnTriggerEnter(Collider other) { CuboElemental cubo = other.transform.GetComponent <CuboElemental> (); if (cubo == null) { return; } this._cuboConectado = cubo; }
private void OnTriggerExit(Collider other) { if (this._cuboConectado == null) { return; } if (other.gameObject == this._cuboConectado.gameObject) { this._cuboConectado.desligar(); this._cuboConectado = null; } }