Пример #1
0
 void OnContact()
 {
     if (!spawned)
     {
         spawned = true;
         tileSpawner.Spawn();
     }
 }
    public void ChangeVariation(int shift)
    {
        if (selected.transform.childCount == 0)
        {
            return;
        }
        var infoBlocks = selected.GetComponentsInChildren <InfoOnBlock>();

        DestroySelected();
        for (int i = 0; i < infoBlocks.Length; i++)
        {
            var pos  = infoBlocks[i].transform.position;
            var info = infoBlocks[i].Info;
            info.Variation += shift;
            TileSpawner.Spawn(info, pos);
        }
    }