This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct Broadcast<T: Clone> { | |
senders: ArrayQueue<Vec<crossbeam::channel::Sender<T>>>, | |
pending_senders: ArrayQueue<crossbeam::channel::Sender<T>>, | |
pending_signal: Arc<AtomicBool> | |
} | |
impl<T: Clone> Broadcast<T> { | |
pub fn new() -> Arc<Self> { | |
let senders: ArrayQueue<Vec<crossbeam::channel::Sender<T>>> = ArrayQueue::new(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use glam::DVec2; | |
use rustc_hash::{FxHashMap}; | |
#[derive(Clone, Copy, Debug)] | |
pub struct SpatialHash { | |
cell_size: u32, | |
conv_factor: f32, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::num::Wrapping; | |
use bincode::{Encode, Decode}; | |
// Time is monotonic time (OS ticks) not clock time. The difference is precision vs accuracy. | |
// clock time can have huge variances, be different by over 100ms even when queried within a few ms of each other. Accurate but not precise. | |
// OS ticks are very precise over short intervals. But can drift very quickly over longer periods. | |
// We consume snapshots in sequence order, possibly skipping missing sequences. | |
// The interpolation state time represents our progression through the server timeline. Our server timeline is based on received snapshots. We advance through this timeline using local delta time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Unity.Collections; | |
using UnityEngine; | |
[ExecuteAlways] | |
public class TempAllocTest : MonoBehaviour | |
{ | |
private NativeHashMap<int, int> Map; | |
private void OnEnable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ClientServer.Shared; | |
using Unity.Burst; | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
using Unity.Jobs; | |
using Unity.Mathematics; | |
using Unity.Physics; | |
using UnityEngine; | |
namespace CombatServer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GameCommon.Models; | |
using ProtoBuf; | |
using System; | |
using System.Collections.Generic; | |
using Unity.Mathematics; | |
namespace GameCommon.Features.Land | |
{ | |
[Serializable] | |
[ProtoContract] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ClientServerShared | |
{ | |
public class BinaryAsset | |
{ | |
public static BinaryAssetFolder AssetFolder(string path1, string path2 = null) | |
{ | |
return new BinaryAssetFolder(FolderType.Asset, path1, path2); | |
} | |
public static BinaryAssetFolder PersistentFolder(string path1, string path2 = null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct ProjectedBody | |
{ | |
public const float DampingDefault = 0.01f; | |
public const float TimeStep = 1f / 60f; | |
public static readonly float3 Gravity = new float3(0f, -9.81f, 0f); | |
public float3 StartPosition; | |
public float Damping; | |
public float3 Velocity; | |
public float3 Position; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Unity.Mathematics; | |
namespace GameCommon.Spatial | |
{ | |
public struct SpatialHash | |
{ | |
public const int Goffset = 10000; | |
public const int Max = 20480; | |
public int CellSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace UnityEngine.Rendering | |
{ | |
public class VolumeInstanceHelper : MonoBehaviour | |
{ | |
[HideInInspector] | |
public Volume Volume; | |
private void OnValidate() | |
{ | |
if (Volume == null) |
NewerOlder