August 2018
Beginner
334 pages
10h 19m
English
We'll be creating the graph representation class as well as a custom Vertex class:
using UnityEngine;
using System.Collections.Generic;
public class VertexVisibility : Vertex
{
void Awake()
{
neighbours = new List<Edge>();
}
}
public void FindNeighbours(List<Vertex> vertices)
{
Collider c = gameObject.GetComponent<Collider>();
c.enabled = false;
Vector3 direction = Vector3.zero;
Vector3 origin = transform.position;
Vector3 target = Vector3.zero;
RaycastHit[] hits;
Ray ray;
float distance = 0f;
// next step
}
Read now
Unlock full access