- Test: A test scene with cube primitives
- SampleScene: Default unity URP scene. Play scene and press Scramble and Revert button to play in runtime
- Attach ScamberHandler.cs Component to a gameobject.
- All child gameobjects will automatically be attached with ScramblerInstance.cs
- Adjust initial position by simply going to any Gameobject with ScramblerInstance.cs and moving it in the editor
- You can add more gameobjects into child of ScramblerHandler.cs and it will automatically add a ScramblerInstance.cs
- Call SetState method with input integer to toggle between 4 states
- STOP_REVERT: 0
- Set this state to stop after finishing REVERT
- STOP_SCRAMBLE: 1
- Set this state to stop after finishing SCRAMBLE
- SCRAMBLE: 2
- Set this state to scramble child objects
- REVERT: 3
- Set this state to reverse child objects to original position
- STOP_REVERT: 0
- Define random parameters: random zone, range of rotation, range of scale
- Define how fast objects move with total travel time
- Debug options to visualize movement, rotation and target points etc.
- Refactor position definition to be more consistent
- some positions are affected by parent rotation but some are not. not obvious why
- Account for parent to child scaling
- Interpolate by curve instead of straight line