Transform Class
Constructor
Transform(Vector2Int position)
: Constructs a new instance of the Transform class with the specified position.
Properties
position
: The position of the object represented by a Vector2Int.rotation
: The rotation value of the object.
Methods
Move(Direction direction, int speed, bool ScreenWrap = false)
: Moves the object in the specified direction with the given speed.
Example Usage
// Create a new Transform
Vector2Int position = new Vector2Int(0, 0);
Transform transform = new Transform(position);
// Move the object
int speed = 5;
transform.Move(Direction.Right, speed);
// Retrieve the position
Vector2 currentPosition = transform.position;