Exemplo n.º 1
0
    // 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);
    }
Exemplo n.º 2
0
    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);
    }