Every object in Unity has an instance of the class Transform called "transform", which has methods by which it is manipulated -- this isn't just a convenience, but because we can't access the components within the transform because of encapsulation. This object is manipulated using its own methods and its own methods only -- that is encapsulation. Technically, encapsulation is broken to a degree since we don't call one of the camera's methods to do it, but it still is a level of encapsulation.

Encapsulation and component based programming are not mutually exclusive.

Let me quote the Unity documentation again:
Originally Posted By: Unity Documentation
Every object in a scene has a Transform. It's used to store and manipulate the position, rotation and scale of the object.
The camera has a transform, and we access that component directly rather than through one of the camera's methods (breaking encapsulation to a degree), but we don't manipulate the transform itself except through its own methods (for non-native Enlgish speakers, "it" here refers to the transform, as made clear by "the transform itself"), because presumably its own components (such as world co-ordinates) are private, thus maintaining encapsulation and forcing us to manipulate it through its own methods.

Part of the original complaint was component based (Camera.main.transform...), and part of it was related to encapsulation (transform.Translate(...)).

Jibb


Formerly known as JulzMighty.
I made KarBOOM!