// Slider public List <GameObject> DFS(List <GameObject> foundNeighbors, AiCubeType typeToSearch) { if (foundNeighbors.Contains(this.gameObject)) { return(foundNeighbors); } if (this.cubeType != typeToSearch) { return(foundNeighbors); } foundNeighbors.Add(this.gameObject); foreach (GameObject neighbor in neighborCubes) { foundNeighbors = neighbor.GetComponent <AiCube>().DFS(foundNeighbors, typeToSearch); } return(foundNeighbors); }
void Start() { cubeTransform = gameObject.transform; rb = GetComponent <Rigidbody>(); Debug.Log(rb.velocity); if (gameObject.tag == "FireCube") { cubeType = AiCubeType.Fire; } else if (gameObject.tag == "FrostCube") { cubeType = AiCubeType.Frost; } else if (gameObject.tag == "ArcaneCube") { cubeType = AiCubeType.Arcane; } Debug.Log(cubeType); }