Skip to content

Instantly share code, notes, and snippets.

View bddckr's full-sized avatar

Christopher-Marcel Esser bddckr

View GitHub Profile

Using VRTK as a submodule works just fine! Steps:

Set up symlinks for git on Windows:

To allow symlinks you need to use Windows Vista or later, have admin rights or a specific privilege and use NTFS: https://github.com/git-for-windows/git/wiki/Symbolic-Links Install the latest git via https://git-scm.com/downloads and make sure to use the installer. Make sure to at least use "Use Git from the Windows Command Prompt" and at the last step make sure to tick the checkbox "Enable symbolic links".

@bddckr
bddckr / CleanUpGameObjectSystem.cs
Last active July 14, 2021 07:55
A small example on how to use the same kind of system for multiple contexts in Entitas 0.37.0(+) while making usage of a shared component.
using System.Collections.Generic;
using Components.GameObjects;
using Components.Miscellaneous;
using Entitas;
using Entitas.Unity.VisualDebugging;
using EntitasHelpers;
using JetBrains.Annotations;
public sealed class CleanUpGameObjectSystem<TEntity> : ReactiveSystem<TEntity> where TEntity : class, IEntity, new()
{
@bddckr
bddckr / CleanUpGameObjectSystem.cs
Created February 22, 2017 14:40
Example of a generic system for multiple typed entities. (Entitas 0.37.0(+))
using System.Collections.Generic;
using Components.GameObjects;
using Components.Miscellaneous;
using Entitas;
using Entitas.Unity.VisualDebugging;
using EntitasHelpers;
using JetBrains.Annotations;
public sealed class CleanUpGameObjectSystem<TEntity> : ReactiveSystem<TEntity> where TEntity : class, IEntity, new()
{
using System;
using UnityEngine;
using VRTK;
[RequireComponent(typeof(VRTK_InteractGrab))]
public class InteractableObjectGrabHook : MonoBehaviour
{
[Tooltip("How long a complete move of the interactable object should take (in either direction).")]
public float Duration;
@bddckr
bddckr / DetailedCollector.cs
Last active February 16, 2017 14:04
A more detailed collector and reactive system for Entitas 0.37.0(+).
namespace Entitas
{
using System.Collections.Generic;
using System.Text;
using Entitas;
/// An Collector can observe one or more groups and collects
/// changed entities based on the specified groupEvent.
public sealed class DetailedCollector<TEntity> where TEntity : class, IEntity, new()
{
@bddckr
bddckr / DestroySystem.cs
Last active July 13, 2021 20:40
A small example on how to use the same kind of system for multiple contexts in Entitas 0.37.0(+).
using System.Collections.Generic;
using Components.Miscellaneous;
using Entitas;
using EntitasHelpers;
using JetBrains.Annotations;
public sealed class DestroySystem<TEntity> : ReactiveSystem<TEntity> where TEntity : class, IEntity, new()
{
private readonly Context<TEntity> _context;
private IMatcher<TEntity> _triggerMatcher;
@bddckr
bddckr / PhotonRealtimeLimits.md
Last active April 16, 2019 03:16
Infos on the messages/second per room limit in Photon Realtime.

Besides the CCU limit in Photon which you can easily increase by paying more there is a messages/second per room limit in Photon Realtime.

Dunno about latency, but the official Photon limit is 500 messages/second per room. Let's say s is your sendrate (s messages per second) and n is the maximum number of players allowed in a room.

So it's 500 = s * n^2 if you do the easy synchronization where every player sends their position etc. to all the other players. Photon counts that as: 1 sent message + n-1 received messages = n messages.

This results in n = 7 for a sendrate s = 10.

@bddckr
bddckr / DetailedCollector.cs
Created February 8, 2017 13:10
A more detailed collector and reactive system for Entitas.
namespace Entitas
{
using System.Collections.Generic;
using System.Text;
using Serialization;
/// An Collector can observe one or more groups and collects
/// changed entities based on the specified groupEvent.
public sealed class DetailedCollector
{
@bddckr
bddckr / SteamUGC-KeyValueTagsQuery.cs
Last active January 30, 2017 17:19
Example to show how to use a query to get the key value tags for the user's subscribed items using Steamworks.NET.
/*
Keys can map to multiple different values (1-to-many relationship).
Key names are restricted to alpha-numeric characters and the '_' character.
Both keys and values cannot exceed 255 characters in length.
Key-value tags are searchable by exact match only.
Taken from https://partner.steamgames.com/documentation/ugc
*/
@bddckr
bddckr / DestroySystem.cs
Last active February 15, 2017 19:12
A system to destroy entities in Entitas, for all pools
using System;
using System.Collections.Generic;
using System.Linq;
using Entitas;
public sealed class DestroySystem : ISetPools, IGroupObserverSystem
{
public GroupObserver groupObserver
{
get