#[repr(C)]pub struct Camera {
pub component: Component,
}Fields§
§component: ComponentBase Component structure
Implementations§
Source§impl Camera
impl Camera
Sourcepub fn get_main() -> Result<Option<Camera>, String>
pub fn get_main() -> Result<Option<Camera>, String>
Gets the main camera in the scene (Camera.main)
§Returns
Result<Option<Camera>, String>- The main camera if it exists
Sourcepub fn get_current() -> Result<Option<Camera>, String>
pub fn get_current() -> Result<Option<Camera>, String>
Gets the current camera (for rendering events)
§Returns
Result<Option<Camera>, String>- The current camera if it exists
Sourcepub fn get_all_count() -> Result<i32, String>
pub fn get_all_count() -> Result<i32, String>
Gets the count of all active cameras
§Returns
Result<i32, String>- The number of all cameras enabled in the scene
Sourcepub fn get_all_cameras() -> Result<Vec<Camera>, String>
pub fn get_all_cameras() -> Result<Vec<Camera>, String>
Gets a list of all active cameras
§Returns
Result<Vec<Camera>, String>- A vector containing all active cameras
Sourcepub fn get_depth(&self) -> Result<f32, String>
pub fn get_depth(&self) -> Result<f32, String>
Gets the depth of the camera
§Returns
Result<f32, String>- The camera’s depth in the rendering order
Sourcepub fn get_field_of_view(&self) -> Result<f32, String>
pub fn get_field_of_view(&self) -> Result<f32, String>
Sourcepub fn world_to_screen_point(
&self,
position: Vector3,
eye: CameraEye,
) -> Result<Vector3, String>
pub fn world_to_screen_point( &self, position: Vector3, eye: CameraEye, ) -> Result<Vector3, String>
Sourcepub fn screen_to_world_point(
&self,
position: Vector3,
eye: CameraEye,
) -> Result<Vector3, String>
pub fn screen_to_world_point( &self, position: Vector3, eye: CameraEye, ) -> Result<Vector3, String>
Sourcepub fn camera_to_world_matrix(&self) -> Result<Matrix4x4, String>
pub fn camera_to_world_matrix(&self) -> Result<Matrix4x4, String>
Gets the camera to world matrix
§Returns
Result<Matrix4x4, String>- The matrix that transforms from camera space to world space
Methods from Deref<Target = Component>§
Sourcepub fn get_game_object(&self) -> Result<GameObject, String>
pub fn get_game_object(&self) -> Result<GameObject, String>
Returns the GameObject attached to this component.
Sourcepub fn get_transform(&self) -> Result<Transform, String>
pub fn get_transform(&self) -> Result<Transform, String>
Returns the Transform attached to this component.
Sourcepub fn get_component<T: ComponentTrait>(
&self,
class: &Class,
) -> Result<T, String>
pub fn get_component<T: ComponentTrait>( &self, class: &Class, ) -> Result<T, String>
Resolves another component of the specified class on the same GameObject.
Methods from Deref<Target = UnityObject>§
Methods from Deref<Target = Object>§
Sourcepub fn field(&self, name: &str) -> Option<Field>
pub fn field(&self, name: &str) -> Option<Field>
Returns an instance-bound field lookup.
The returned Field carries this object’s instance pointer so
Field::get_value and
Field::set_value can operate on it.
Sourcepub fn method<S: MethodSelector>(&self, selector: S) -> Option<Method>
pub fn method<S: MethodSelector>(&self, selector: S) -> Option<Method>
Returns an instance-bound method lookup.
This is the preferred way to prepare instance method calls because the
returned Method already carries the correct this pointer.
Sourcepub fn property(&self, name: &str) -> Option<Property>
pub fn property(&self, name: &str) -> Option<Property>
Returns an instance-bound property lookup.
Sourcepub fn il2cpp_to_string(&self) -> String
pub fn il2cpp_to_string(&self) -> String
Sourcepub fn get_game_object(&self) -> Result<GameObject, String>
pub fn get_game_object(&self) -> Result<GameObject, String>
Gets the GameObject associated with this object (if Is a Component)
§Returns
Result<GameObject, String>- The GameObject, or an error if null/not found