Example #1
0
    private EnvironmentCube CreateCube(GameObject prefab, GridCoordinates coordinates)
    {
        GameObject gameObject = GameObject.Instantiate(prefab) as GameObject;

        gameObject.transform.parent   = transform;
        gameObject.transform.position = coordinates.GetWorldPosition();

        EnvironmentCube environmentCube = gameObject.GetComponent <EnvironmentCube>();

        environmentCube._coordinates = coordinates;

        return(environmentCube);
    }