void OnTriggerEnter2D(Collider2D other) { if (Utils.DetermineObjectType(other) != Utils.ObjectType.Player) { if (Utils.DetermineObjectType(other) == Utils.ObjectType.Wall) { Destroy(gameObject); } return; } if (!other.CompareTag(currP)) { //other.SendMessage("TakeDamage", damage, SendMessageOptions.DontRequireReceiver); //other.GetComponent<PlayerTime>().timeRemaining -= damage; PlayerTime.TransferTime(damage, other.gameObject, GameObject.FindGameObjectWithTag(currP)); Destroy(gameObject); } /*if (other.gameObject != gameObject) * { * other.SendMessage("TakeDamage", damage, SendMessageOptions.DontRequireReceiver); * other.GetComponent<PlayerTime>().timeRemaining -= damage; * Destroy(gameObject); * }*/ }
void Attack() { delay = 0.0f; if (Utils.DetermineObjectType(playerAttacked) == Utils.ObjectType.Player) { PlayerTime.TransferTime(damage, playerAttacked.gameObject, gameObject); } }