Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Ochs gamemachine

View GitHub Profile
View SpatialHash.cs
using Unity.Mathematics;
namespace GameCommon.Spatial
{
public struct SpatialHash
{
public const int Goffset = 10000;
public const int Max = 20480;
public int CellSize;
View VolumeInstanceHelper.cs
namespace UnityEngine.Rendering
{
public class VolumeInstanceHelper : MonoBehaviour
{
[HideInInspector]
public Volume Volume;
private void OnValidate()
{
if (Volume == null)
View ColliderPartition.cs
using System.Collections.Generic;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Physics;
using Unity.Collections;
using static Unity.Physics.CompoundCollider;
using Unity.Transforms;
using Unity.Collections.LowLevel.Unsafe;
namespace AiGame.ColliderPartitions
View PrefabConvertToEntity.cs
using Sirenix.OdinInspector;
using System.Collections.Generic;
using Unity.Entities;
using UnityEngine;
namespace AiGame
{
public class PrefabConvertToEntity : MonoBehaviour
{
private const string AssetPath = @"Assets/AiGame/GameData/Resources/EcsPrefabData";
View AvatarMeshCombiner.cs
using System;
using System.Collections.Generic;
using UnityEngine;
namespace AiGame
{
// Design is that you have a target with a SkinnedMeshRenderer and bone hierarchy.
// You provide a list of input SkinnedMeshRenderer's that use the same bone hierarchy as the target
// Bones and bone weights will be mapped to the target.
View crestboat.cs
using Crest;
using System.Collections.Generic;
using Unity.Entities;
using Unity.Mathematics;
using UnityEngine;
namespace AiGame.Boats
{
public class KinematicBuoyancy : MonoBehaviour
{
View VertexSkinning.shader
// For the new DOTS animation. Although you need to use DrawMeshInstanced yourself, Hybrid renderer does not support instanced
// props for builtin.
Shader "Custom/VertexSkinning"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
View HttpServer.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
namespace Server.Http
{
public class HttpServer
View EcsWorld.cs
using AiGame.Ecs.Systems;
using AiNav;
using System;
using System.Collections.Generic;
using Unity.Collections;
using UnityEngine;
namespace Unity.Entities
{
public class EditorModeSystemConfig
View crestfog.cginc
[Header(Fog)]
[Toggle] _ApplyFog("Enable", Float) = 1
_FogColor("Fog Color (RGB)", Color) = (0.5, 0.5, 0.5, 1.0)
_FogStart("Fog Start", Float) = 0.0
_FogEnd("Fog End", Float) = 10.0
#pragma shader_feature _APPLYFOG_ON
fixed4 _FogColor;