Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View joobei's full-sized avatar
💭
Koding^_^

Nikolaos Katzakis joobei

💭
Koding^_^
View GitHub Profile
string jsondata = File.ReadAllText(Application.dataPath + "/../" + fileName + ".json");
Debug.Log (jsondata);
Connection[] temparray = new Connection[JsonHelper.FromJson<Connection>(jsondata).Length];
^---- This is where it breaks.
Debug.Log (temparray.Length);
foreach (Connection connection in JsonHelper.FromJson<Connection>(jsondata))
{
connections.Add (connection);
}
public static class Util
{
public static Vector3[,] generatePositions(List<int> angles, List<float> depths)
{
Vector3[,] positions = new Vector3[angles.Count,depths.Count];
^ ^
NullReferenceException: Object reference not set to an instance of an object
Util.generatePositions (System.Collections.Generic.List`1 angles, System.Collections.Generic.List`1 depths) (at Assets/Scripts/Util.cs:29)
DockingState..ctor () (at Assets/Scripts/States/DockingState.cs:32)
@joobei
joobei / jubei.cs
Created July 27, 2017 14:56
Monobehaviour problem
class State: Monobehaviour {
//reference to the state we will need to jump to
public State nextState;
protected virtual void Update()
{
if (mouseClicked)
{
doSomething();