Skip to content

Commit 496fa82

Browse files
committed
some fixes
1 parent 716aad7 commit 496fa82

File tree

4 files changed

+190
-73
lines changed

4 files changed

+190
-73
lines changed

com.unity.netcode.gameobjects/Prototyping/Interpolator/BufferedLinearInterpolator.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,13 @@ public void OnEnable()
6262
{
6363
}
6464

65+
public void Awake()
66+
{
67+
}
68+
6569
public void OnNetworkSpawn()
6670
{
71+
Update(0);
6772
}
6873

6974
private void TryConsumeFromBuffer()
@@ -172,4 +177,16 @@ public BufferedLinearInterpolatorFloat()
172177
{
173178
}
174179
}
180+
181+
public class BufferedLinearInterpolatorQuaternion : BufferedLinearInterpolator<Quaternion>
182+
{
183+
public override Quaternion Interpolate(Quaternion start, Quaternion end, float time)
184+
{
185+
return Quaternion.Slerp(start, end, time);
186+
}
187+
188+
public BufferedLinearInterpolatorQuaternion()
189+
{
190+
}
191+
}
175192
}

com.unity.netcode.gameobjects/Prototyping/Interpolator/IInterpolator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace Unity.Netcode
44
{
55
public interface IInterpolator<T>
66
{
7+
public void Awake();
78
public void OnNetworkSpawn();
89
public void Start();
910
public void OnEnable();

com.unity.netcode.gameobjects/Prototyping/Interpolator/SimpleInterpolator.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ public class SimpleInterpolatorVector3 : IInterpolator<Vector3>
1212

1313
private const float k_MaxLerpTime = 0.1f;
1414

15+
public void Awake()
16+
{
17+
Update(0);
18+
}
19+
1520
public void OnNetworkSpawn()
1621
{
1722
}

0 commit comments

Comments
 (0)