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
void ClipBounds(float4 bounds, float2 pos) { | |
float2 min = bounds.xy; | |
float2 max = bounds.zw; | |
float a = step(min.x, pos.x); | |
float b = step(pos.x, max.x); | |
float c = step(min.y, pos.y); | |
float d = step(pos.y, max.y); | |
clip(3.0f - a - b - c - d); |
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 System.Collections.Generic; | |
using System.IO; | |
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
namespace Crest | |
{ | |
public class BakedOceanDepthCache : MonoBehaviour | |
{ | |
[SerializeField] |
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; | |
using UnityEngine; | |
namespace AiGame.Terrains | |
{ | |
public struct SplatWeights | |
{ | |
public float Splat0; | |
public float Splat1; | |
public float Splat2; |
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 System; | |
using Unity.Collections; | |
using Unity.Mathematics; | |
namespace AiGame.UnityPhysics | |
{ | |
public class UnityPhysicsMods | |
{ | |
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 static void AddCommonTypes(RuntimeTypeModel model) | |
{ | |
model.Add(typeof(float4), false) | |
.Add(1, "x") | |
.Add(2, "y") | |
.Add(3, "z") | |
.Add(4, "w"); | |
model.Add(typeof(float3), false) | |
.Add(1, "x") |
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 System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
namespace GameCommon.Pooling | |
{ | |
public class ByteArrayPool | |
{ | |
private const int MaxArrayLength = 512; | |
private const int MaxRentTime = 1000; // in milliseconds |
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 JacksonDunstan.NativeCollections; | |
using System; | |
using System.Threading; | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
namespace AiGame.Containers | |
{ | |
public struct NativeMPMCQueue<T> where T : struct | |
{ |
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 static string GetSerializationPath(string name) | |
{ | |
return string.Format("{0}/{1}.bin", Application.streamingAssetsPath, name); | |
} | |
public static unsafe BlobAssetReference<Collider> DeserializeCollider(string filename, int bytes) | |
{ | |
string path = GetSerializationPath(filename); | |
using (StreamBinaryReader reader = new StreamBinaryReader(path, bytes)) |
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 System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
#if !ENABLE_IL2CPP && !NET_STANDARD_2_0 | |
using System.Reflection.Emit; | |
#endif | |
namespace AwesomeTechnologies.Utility |
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 Unity.Mathematics; | |
namespace AiGame | |
{ | |
public struct NativeSpatialGrid | |
{ | |
private const float Goffset = 10000f; | |
public int Id; |