Skip to content

Instantly share code, notes, and snippets.

View Scraft's full-sized avatar

Steven Craft Scraft

View GitHub Profile
@Scraft
Scraft / Test.cpp
Created October 18, 2017 11:44
Example of overriding send/receive with netcode.io
/*
netcode.io reference implementation
Copyright © 2017, The Network Protocol Company, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
@Scraft
Scraft / GameObjectUtilities.cs
Created October 10, 2016 13:09
Cloning game objects in UI hierachy
private static void CopyComponentInternal(Component original, Component destination)
{
if (original == null || destination == null)
{
//Debug.LogError("Null Objects in copy");
return;
}
Type type = original.GetType();
//if (type != other.GetType()) return null; // type mis-match