Skip to content

Instantly share code, notes, and snippets.

View LukasKastern's full-sized avatar

Lukas Kastern LukasKastern

View GitHub Profile
@LukasKastern
LukasKastern / LICENSE
Created December 15, 2022 12:11 — forked from yamnikov-oleg/LICENSE
Shared (interprocess) mutexes on Linux
MIT License
Copyright (c) 2018 Oleg Yamnikov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
[AlwaysUpdateSystem]
[UpdateInGroup( typeof( InitializationSystemGroup ) )]
public partial class InstantiateBuildingStageColliders : SystemBase
{
private EntityQuery m_instantiateQuery;
private EntityQuery m_cleanupQuery;
private EndInitializationEntityCommandBufferSystem m_barrier;
public struct BuildableColliders : ISystemStateBufferElementData
@LukasKastern
LukasKastern / DBufferDecal.shader
Created November 28, 2021 13:44
Extracted URP (v12.1) DBufferDecal shader from shader graph
Shader "DBufferDecal"
{
Properties
{
[HideInInspector]_DrawOrder("Draw Order", Range(-50, 50)) = 0
[HideInInspector][Enum(Depth Bias, 0, View Bias, 1)]_DecalMeshBiasType("DecalMesh BiasType", Float) = 0
[HideInInspector]_DecalMeshDepthBias("DecalMesh DepthBias", Float) = 0
[HideInInspector]_DecalMeshViewBias("DecalMesh ViewBias", Float) = 0
[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
using Unity.Collections.LowLevel.Unsafe;
namespace Unity.Entities
{
[NativeContainer]
public unsafe struct EntityExistsFromEntity
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
readonly AtomicSafetyHandle m_Safety;
#endif
using System;
using UnityEngine;
using Hash128 = Unity.Entities.Hash128;
#if UNITY_EDITOR
using UnityEditor;
[CustomPropertyDrawer( typeof( SubSceneReference ) )]
public class SubSceneReferencePropertyDrawer : PropertyDrawer
{
@LukasKastern
LukasKastern / RollBehavior.cs
Created August 29, 2020 00:23
Simple NavMeshAgent with a rolling movement
using UnityEngine;
using UnityEngine.AI;
[RequireComponent(typeof(NavMeshAgent))]
public class RollBehavior : MonoBehaviour
{
/// <summary>
/// Distance the agent will elapse when rolling per second.
/// </summary>
public float rollSpeed;