#[repr(transparent)]pub struct Transform(pub Object);Expand description
UnityEngine.Transform: position in the scene and the parent/child hierarchy.
Tuple Fields§
§0: ObjectImplementations§
Source§impl Transform
impl Transform
pub const ASSEMBLY: &'static str = "UnityEngine.CoreModule"
pub const NAMESPACE: &'static str = "UnityEngine"
pub const NAME: &'static str = "Transform"
pub fn object(&self) -> Object
pub fn is_null(&self) -> bool
pub fn name(&self) -> Result<String>
pub fn set_name(&self, name: &str) -> Result<()>
Sourcepub fn dont_destroy_on_load(&self) -> Result<()>
pub fn dont_destroy_on_load(&self) -> Result<()>
Keeps the object when a new scene loads. Only works for GameObjects;
for assets (Material, Texture2D) use set_hide_flags.
Sourcepub fn set_hide_flags(&self, flags: HideFlags) -> Result<()>
pub fn set_hide_flags(&self, flags: HideFlags) -> Result<()>
Sets the object’s HideFlags. HideFlags::HIDE_AND_DONT_SAVE keeps a
runtime-created asset from being unloaded on scene load.
Source§impl Transform
impl Transform
pub fn set_parent( &self, parent: Transform, world_position_stays: bool, ) -> Result<()>
pub fn set_local_scale(&self, scale: Vector3) -> Result<()>
pub fn set_position(&self, position: Vector3) -> Result<()>
Sourcepub fn local_position(&self) -> Result<Vector3>
pub fn local_position(&self) -> Result<Vector3>
Position relative to the parent.
pub fn set_local_position(&self, position: Vector3) -> Result<()>
Sourcepub fn euler_angles(&self) -> Result<Vector3>
pub fn euler_angles(&self) -> Result<Vector3>
World-space rotation as Euler angles in degrees.
pub fn rotation(&self) -> Result<Quaternion>
pub fn set_rotation(&self, rotation: Quaternion) -> Result<()>
Sourcepub fn parent(&self) -> Result<Option<Transform>>
pub fn parent(&self) -> Result<Option<Transform>>
The parent transform, or None at the scene root.
pub fn child_count(&self) -> Result<i32>
pub fn child(&self, index: i32) -> Result<Transform>
Trait Implementations§
Source§impl ComponentType for Transform
impl ComponentType for Transform
const ASSEMBLY: &'static str = "UnityEngine.CoreModule"
const NAMESPACE: &'static str = "UnityEngine"
const NAME: &'static str = "Transform"
fn from_object(object: Object) -> Self
fn object(&self) -> Object
fn game_object(&self) -> Result<GameObject>
fn transform(&self) -> Result<Transform>
Source§fn get_component<U: ComponentType>(&self) -> Result<Option<U>>
fn get_component<U: ComponentType>(&self) -> Result<Option<U>>
GetComponent<U>() on this component’s game object, or None if absent.Source§fn is_enabled(&self) -> Result<bool>
fn is_enabled(&self) -> Result<bool>
Whether the component is enabled. For
Behaviour-derived components
(MonoBehaviour, Canvas, …); meaningless on a plain Transform.fn set_enabled(&self, enabled: bool) -> Result<()>
impl Copy for Transform
impl Eq for Transform
Source§impl Il2CppValue for Transform
impl Il2CppValue for Transform
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more