An Actor is any object that can be placed into a level, such as a Camera, static mesh, or player start location. Actors support 3D transformations such as translation, rotation, and scaling. They can be created (spawned) and destroyed through gameplay code (C++ or Blueprints).
In C++, AActor is the base class of all Actors
Each actor has a instigator, in new version it is private so ues GetInstigator() to get it .
Delegates
Data types that reference and execute member functions on C++ Objects.
mod back_of_house { fnfix_incorrect_order() { cook_order(); super::serve_order(); }
fncook_order() {} }
使用struct 来定义结构体成员变量,使用impl来定义结构方法
使用trait关键字定义一个接口
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
traitArea{ fnarea(&self) -> f64; }
structCircle{ r : f64; } impl Area for Circle{ fnarea(&self) -> f64{ (3.14 * self.r) } } fnmain(){ let r = Circle{r :10.5}; println!("area={:?}",r.area()); }
std::include
1 2 3 4
let my_string = include!("monkeys.in"); mod math{ include!("math.rs"); }