August 2018
Beginner
334 pages
10h 19m
English
The following code is for the Graph class:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public abstract class Graph : MonoBehaviour
{
public GameObject vertexPrefab;
protected List<Vertex> vertices;
protected List<List<Vertex>> neighbours;
protected List<List<float>> costs;
// next steps
}
public virtual void Start()
{
Load();
}
public virtual void Load() { }
public virtual int GetSize()
{
if (ReferenceEquals(vertices, null))
return 0;
return vertices.Count;
}
Read now
Unlock full access