|
Post by Nikaas on Jun 4, 2017 14:59:34 GMT
Hi, I'm trying to understand how PC2D (extensions and ProCamera2D.Move) works in an effort to make a custom extension.
Can you please explain what PositionDeltaChanger type of extensions do? I thought they kind of override the position of the camera but it seems there is such type of extensions called PositionOverrider.
|
|
|
Post by Luís Pedro Fonseca on Jun 5, 2017 10:01:44 GMT
Hi nikaas, that's a very good question. This info should actually be on the User Guide, so I'll try to find some time to put it there.
There are 6 types of interfaces that each extension can implement and they are called in this order on the Move method of the Core component: - Pre-Movers - Size Delta Changers - Size Overriders - Position Delta Changers - Position Overriders - Post-Movers
The Pre-Movers are extensions that act before any camera calculations. (PointerInfluence, PanAndZoom, etc) The Size Delta Changers are extensions that change the camera size that occurred in the current frame. (SpeedBasedZoom, PanAndZoom) The Size Overriders are extensions that override the camera size regardless of what occurred in the current frame. (NumericBoundaries, Cinematics, Rooms, etc) The Position Delta Changers are extensions that change the camera movement that occurred in the current frame (CameraWindow, LimitSpeed, LimitDistance, etc) The Position Overriders are extensions that override the camera movement regardless of what occurred in the current frame (PixelPerfect, Cinematics, Rooms, etc) The Post-Movers are extensions that act after all camera calculations. (Repeater, Parallax, etc)
Notice that each extension can implement various interfaces, since they often have to change the size and position of the camera, or simply do something after or before the camera movement.
Also, notice that each interface has an "order" property so that we know in when an extension method is called.
|
|