Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. Line endings and spacing makes updates do-or-die, no inbetween. Therefore very difficult to know exactly what changed from version to version of a script.
  2.  
  3. EntityPrefabRoot.cs
  4. Added interpolation to position and rotation
  5.  
  6. FROM:
  7. // apply new position (+ potential error correction)
  8. transform.position = newPosition + _errorVisualVector;
  9. transform.rotation = newRotation * _errorVisualQuaternion;
  10.  
  11. TO:
  12. // apply new position (+ potential error correction)
  13. transform.position = positionTeleport ? newPosition : Vector3.Lerp(transform.position, newPosition + _errorVisualVector, Time.deltaTime * Constants.PrefabInterpolationTime);
  14. transform.rotation = rotationTeleport ? newRotation : Quaternion.Lerp(transform.rotation, newRotation * _errorVisualQuaternion, Time.deltaTime * Constants.PrefabInterpolationTime);
  15.  
  16.  
  17.  
  18. EntityPrefabViewUpdater.cs
  19. We have created our own version of this to make updates easier, as it has more changes
  20. Our EPVU is a singleton that exists throughout scene changes, so is set to DontDestroyOnLoad.
  21. We have had a bug with it due to this, where the EPVU will subscribe to OnUpdateView on its QuantumCallbacks parent, but in reality it will subscribe to its own OnUpdateView function.
  22. This would cause it to subscribe several times and cause several calls to OnUpdateView on every Unity update.
  23.  
  24. I have renamed OnUpdateView, and am manually subscribe and unsubscribe from the right QuantumGame, both the live game and the replay game supplied by our ReplayController.
  25.  
  26. Changed CreateEntityIfNeeded where if it's a transform2D i calles CreateEntityPrefabInstance with "transform2D->Position.ToUnityVector2".
  27. CreateEntityPrefabInstance takes a Unity Vector3. transform2D->Position.ToUnityVector2 will give (x, y) which is then made cast to a Vector3 so (x, y, 0).
  28. This caters to 2D games that are X, Y (side-view), but ours is X, Z (top down).
  29. Changed to transform2D->Position.ToUnityVector3()
  30.  
  31. Added extra function calls in DestroyPrefab to call code for visual destruction. We still haven't changed code to use the new ManualDestroy.
  32.  
  33. MapDataBaker.cs
  34. I have hooked into baking of the colliders because we need to bake the ID's of some manual colliders.
  35. We have destructible walls and each wall needs a unique ID from [0 - count of walls], so I can turn match them to a bitset quantum side.
  36. I have therefore put a line of code in
  37. foreach (var collider in UnityEngine.Object.FindObjectsOfType<QuantumStaticBoxCollider2D>())
  38. where I set the ID.
  39.  
  40.  
  41. QuantumRunnerLocalDebug.cs
  42. Made our own version due to needing extra functionality. (Instantiating controllers, setting correct settings, etc.)
  43.  
  44. QuantumRunner.cs
  45. Add support for more than 1 local player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement