private void visit(IPoint <IUserObject> aPoint) { IUserObject currentUserObject = aPoint.GetUserObject(); IShape currentShape = currentUserObject.GetShape(); IUserObject insertedUserObject = this.insertedPoint.GetUserObject(); IShape insertedShape = insertedUserObject.GetShape(); bool collision = checkCollision(currentShape, insertedShape); if (collision) { insertedUserObject.TakeDamage(this.damagePoint); currentUserObject.TakeDamage(this.damagePoint); } }
private void Visit(IPoint <IUserObject> aPoint) { IUserObject currentUserObject = aPoint.GetUserObject(); IShape currentShape = currentUserObject.GetShape(); IUserObject insertedUserObject = this.insertedPoint.GetUserObject(); IShape insertedShape = insertedUserObject.GetShape(); bool collision = CheckCollision(currentShape, insertedShape); if (collision) { insertedUserObject.TakeDamage(this.damagePoint); currentUserObject.TakeDamage(this.damagePoint); ParticleSystem particleSystem = currentUserObject.GetGameObject().GetComponent <ParticleSystem> (); particleSystem.Play(); ChangeTransparencyAccordingToHealth(insertedUserObject); ChangeTransparencyAccordingToHealth(currentUserObject); } }