gg.easy.airship 0.1.2145 → 0.1.2146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// ReSharper disable InconsistentNaming
|
|
2
2
|
namespace Code {
|
|
3
3
|
public static class AirshipConst {
|
|
4
|
-
public const int playerVersion =
|
|
4
|
+
public const int playerVersion = 10;
|
|
5
5
|
|
|
6
6
|
/// <summary>
|
|
7
7
|
/// The server will kick clients that have a playerVersion lower than this value.
|
|
8
8
|
/// </summary>
|
|
9
|
-
public const int minAcceptedPlayerVersionOnServer =
|
|
9
|
+
public const int minAcceptedPlayerVersionOnServer = 10;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -1465,13 +1465,13 @@ namespace Code.Player.Character.MovementSystems.Character {
|
|
|
1465
1465
|
if (mode == NetworkedStateSystemMode.Observer) {
|
|
1466
1466
|
return;
|
|
1467
1467
|
}
|
|
1468
|
-
|
|
1468
|
+
|
|
1469
1469
|
if (!_smoothLookVector) {
|
|
1470
1470
|
var lookTarget = new Vector3(lookVector.x, 0, lookVector.z);
|
|
1471
1471
|
if (lookTarget == Vector3.zero) {
|
|
1472
1472
|
lookTarget = new Vector3(0, 0, .01f);
|
|
1473
1473
|
}
|
|
1474
|
-
|
|
1474
|
+
|
|
1475
1475
|
//Instantly rotate for owner
|
|
1476
1476
|
airshipTransform.rotation = Quaternion.LookRotation(lookTarget).normalized;
|
|
1477
1477
|
} else {
|
|
@@ -1577,9 +1577,15 @@ namespace Code.Player.Character.MovementSystems.Character {
|
|
|
1577
1577
|
_smoothLookVector = moveDirMode == MoveDirectionMode.Camera;
|
|
1578
1578
|
}
|
|
1579
1579
|
|
|
1580
|
-
|
|
1580
|
+
/// <summary>
|
|
1581
|
+
/// Call this from C# to let Luau scripts know we've updated the look vector.
|
|
1582
|
+
/// Example: A teleport RPC.
|
|
1583
|
+
/// </summary>
|
|
1584
|
+
/// <param name="lookVector"></param>
|
|
1585
|
+
[HideFromTS]
|
|
1586
|
+
public void SetLookVectorAndNotifyLuau(Vector3 lookVector) {
|
|
1581
1587
|
OnNewLookVector?.Invoke(lookVector);
|
|
1582
|
-
|
|
1588
|
+
SetLookVector(lookVector);
|
|
1583
1589
|
}
|
|
1584
1590
|
|
|
1585
1591
|
/// <summary>
|
|
@@ -1587,7 +1593,7 @@ namespace Code.Player.Character.MovementSystems.Character {
|
|
|
1587
1593
|
/// Useful for something that is updating the lookVector frequently and needs to listen for other scripts modifying the lookVector.
|
|
1588
1594
|
/// </summary>
|
|
1589
1595
|
/// <param name="lookVector"></param>
|
|
1590
|
-
public void
|
|
1596
|
+
public void SetLookVector(Vector3 lookVector) {
|
|
1591
1597
|
// Don't set look vectors on observed characters
|
|
1592
1598
|
if (mode == NetworkedStateSystemMode.Observer) {
|
|
1593
1599
|
return;
|
|
@@ -1612,7 +1618,7 @@ namespace Code.Player.Character.MovementSystems.Character {
|
|
|
1612
1618
|
}
|
|
1613
1619
|
}
|
|
1614
1620
|
|
|
1615
|
-
public void
|
|
1621
|
+
public void SetLookVectorToMoveDir() {
|
|
1616
1622
|
// Don't set look vectors on observed characters
|
|
1617
1623
|
if (mode == NetworkedStateSystemMode.Observer) {
|
|
1618
1624
|
return;
|
|
@@ -1675,7 +1681,7 @@ namespace Code.Player.Character.MovementSystems.Character {
|
|
|
1675
1681
|
// TODO: why? Copied from old movement
|
|
1676
1682
|
currentMoveSnapshot.airborneFromImpulse = true;
|
|
1677
1683
|
rb.MovePosition(position);
|
|
1678
|
-
|
|
1684
|
+
SetLookVectorAndNotifyLuau(lookVector);
|
|
1679
1685
|
}
|
|
1680
1686
|
|
|
1681
1687
|
public void SetMovementEnabled(bool isEnabled) {
|
|
@@ -1870,7 +1876,7 @@ namespace Code.Player.Character.MovementSystems.Character {
|
|
|
1870
1876
|
|
|
1871
1877
|
[TargetRpc]
|
|
1872
1878
|
public void RpcSetLookVector(Vector3 lookVector) {
|
|
1873
|
-
|
|
1879
|
+
SetLookVectorAndNotifyLuau(lookVector);
|
|
1874
1880
|
}
|
|
1875
1881
|
|
|
1876
1882
|
[TargetRpc]
|