Sync daemon authority migration
This commit is contained in:
parent
030b4b5d74
commit
39a0dc8737
295 changed files with 25121 additions and 7360 deletions
|
|
@ -1,8 +1,4 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Unity.Mathematics;
|
||||
using static Unity.Mathematics.math;
|
||||
|
||||
public class ShieldTest : MonoBehaviour
|
||||
{
|
||||
|
|
@ -12,12 +8,13 @@ public class ShieldTest : MonoBehaviour
|
|||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
_velocity += -sign(transform.position.x) * Acceleration * Time.deltaTime;
|
||||
var previousX = transform.position.x;
|
||||
_velocity += -Mathf.Sign(transform.position.x) * Acceleration * Time.deltaTime;
|
||||
transform.position += Vector3.right * (_velocity * Time.deltaTime);
|
||||
}
|
||||
|
||||
private void OnCollisionEnter(Collision other)
|
||||
{
|
||||
_velocity = -_velocity;
|
||||
if (Mathf.Sign(transform.position.x) != Mathf.Sign(previousX))
|
||||
{
|
||||
_velocity = -_velocity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue