Пример #1
0
    public void StartPatching()
    {
        _holes.ForEach(x => GameObject.Destroy(x));
        _patches.ForEach(x => GameObject.Destroy(x));
        _holes.Clear();
        _patches.Clear();

        for (int i = 0; i < 22; i++)
        {
            var holePosition = new Vector3(_xPos * _xMod, _yPos * _yMod, 1);

            GameObject newHole = Instantiate(hole, holePosition, Quaternion.Euler(0, 0, 0), _thisTransform);
            newHole.name = "My Hole " + i;
            newHole.GetComponent <Hole>().Difficulty       = i;
            newHole.GetComponent <MeshRenderer>().material = HoleMaterial;
            _holes.Add(newHole);

            SpiraliseHoles();
        }

        Stencil.GiveHole(_holes[0]);
    }