Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- EntityPrefabRoot.cs
- Added interpolation to position and rotation
- FROM:
- // apply new position (+ potential error correction)
- transform.position = newPosition + _errorVisualVector;
- transform.rotation = newRotation * _errorVisualQuaternion;
- TO:
- // apply new position (+ potential error correction)
- transform.position = positionTeleport ? newPosition : Vector3.Lerp(transform.position, newPosition + _errorVisualVector, Time.deltaTime * Constants.PrefabInterpolationTime);
- transform.rotation = rotationTeleport ? newRotation : Quaternion.Lerp(transform.rotation, newRotation * _errorVisualQuaternion, Time.deltaTime * Constants.PrefabInterpolationTime);
- EntityPrefabViewUpdater.cs
- We have created our own version of this to make updates easier, as it has more changes
- Our EPVU is a singleton that exists throughout scene changes, so is set to DontDestroyOnLoad.
- 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.
- This would cause it to subscribe several times and cause several calls to OnUpdateView on every Unity update.
- 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.
- Changed CreateEntityIfNeeded where if it's a transform2D i calles CreateEntityPrefabInstance with "transform2D->Position.ToUnityVector2".
- CreateEntityPrefabInstance takes a Unity Vector3. transform2D->Position.ToUnityVector2 will give (x, y) which is then made cast to a Vector3 so (x, y, 0).
- This caters to 2D games that are X, Y (side-view), but ours is X, Z (top down).
- Changed to transform2D->Position.ToUnityVector3()
- Added extra function calls in DestroyPrefab to call code for visual destruction. We still haven't changed code to use the new ManualDestroy.
- MapDataBaker.cs
- I have hooked into baking of the colliders because we need to bake the ID's of some manual colliders.
- 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.
- I have therefore put a line of code in
- foreach (var collider in UnityEngine.Object.FindObjectsOfType<QuantumStaticBoxCollider2D>())
- where I set the ID.
- QuantumRunnerLocalDebug.cs
- Made our own version due to needing extra functionality. (Instantiating controllers, setting correct settings, etc.)
- QuantumRunner.cs
- Add support for more than 1 local player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement