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 LoadMod(string mpath, string json) { | |
Debug.Log("Trying to load mod at '" + mpath + "'"); | |
// Load JSON | |
ReadTextFile reader = new ReadTextFile(); | |
string jsonSource = reader.Read(json); | |
Debug.Log(jsonSource); | |
string ax = JsonConvert.DeserializeObject<string>(jsonSource); |
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
loader.destroyInstance = (object instance) => DestroyObject (instance); | |
public void DestroyObject(object instance) { | |
if (instance is Component) | |
Destroy (instance as Component); | |
} |
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
loader.createInstance = (Type t) => | |
{ | |
string fileName = t.ToString() + ".cs"; | |
Debug.Log(t.GetType()); | |
foreach (var mod in modLoader.mods) { | |
string modPath = mod.path + "/Scripts/"; | |
foreach (var script in mod.scripts) { | |
string shortPath = script.Substring(modPath.Length); | |
if(shortPath == fileName) { | |
Debug.Log("found a match: '" + fileName + "' is from Mod: '" + mod.name + "'"); |
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
loader.createInstance = (Type t) => | |
{ | |
bool found = false; | |
string fileName = t.ToString() + ".cs"; | |
foreach (var mod in modLoader.mods) { | |
string modPath = mod.path + "/Scripts/"; | |
foreach (var script in mod.scripts) { | |
string shortPath = script.Substring(modPath.Length); | |
if(shortPath == fileName) { | |
if(typeof(Component).IsAssignableFrom(t)){ |
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
consoleView = new GameObject(); | |
consoleView.layer = 5; // UI | |
consoleView.name = "ConsoleView"; |
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
Arduino: 1.6.9 (Windows 10), Board: "ATtiny x313 series, ATtiny2313, 1 MHz (internal), B.O.D. Disabled, no" | |
Build options changed, rebuilding all | |
In file included from C:\arduino-1.6.9\libraries\IRremote\IRremote.h:24:0, | |
from C:\arduino-1.6.9\libraries\IRremote\irRecv.cpp:1: | |
C:\arduino-1.6.9\libraries\IRremote\irRecv.cpp: In member function 'void IRrecv::enableIRIn()': |
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
Type GetType(string name) | |
{ | |
foreach(KeyValuePair<string, Type> script in scripts) | |
{ | |
if(script.Key == name) | |
{ | |
return script.Value; | |
} | |
} |
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
#include <ctime> | |
#include <iostream> | |
#include <string> | |
#include <boost/array.hpp> | |
#include <boost/bind.hpp> | |
#include <boost/shared_ptr.hpp> | |
#include <boost/asio.hpp> | |
using boost::asio::ip::udp; |
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
var client = require('./client.js')('127.0.0.1', 3000); | |
client.sendMessage("new_player"); |
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
if (Input.touchCount > 0) { | |
Ray touchray = Camera.main.ScreenPointToRay (Input.GetTouch (0).position); | |
Debug.DrawRay (touchray.origin, touchray.direction, Color.yellow, 5.0f); | |
} | |
Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition); | |
Debug.DrawRay (ray.origin, ray.direction, Color.green, 5.0f); |