/// <summary> /// начало уровня /// </summary> public void OnStartMatch() { NazadButton.gameObject.active = false; GetMoveLayer.gameObject.active = true; LoadLevel(); //GetMoveLayer.restarting(); GetLevels2.gameObject.SetActive(false); //getSprite = squaresArray[maxCols / 2 * maxRows / 2].GetComponent<SpriteRenderer>().sprite; NextImage.gameObject.active = false; if (modeLvl == 3) { TargetBlockImage.gameObject.SetActive(true); IngredientsCountImage.SetActive(false); } else if (modeLvl == 2) { TargetBlockImage.gameObject.SetActive(false); IngredientsCountImage.SetActive(true); IngredientsCountImage2.SetActive(true); GetMoveLayer.IngredientPosition(ingrCountTarget[0], ingrCountTarget[1]); GetText2.gameObject.SetActive(false); } else if (modeLvl == 1) { TargetBlockImage.gameObject.SetActive(false); IngredientsCountImage.SetActive(true); IngredientsCountImage2.SetActive(true); GetText2.gameObject.SetActive(false); IngredientsCountImage.GetComponent <Image>().sprite = GetSpritesFromItem[(int)collectItems[0]]; IngredientsCountImage2.GetComponent <Image>().sprite = GetSpritesFromItem[(int)collectItems[1]]; if ((uint)limitType == 1 && GetMoveLayer.state == 0) { StopCoroutine(GetEnumerator()); StartCoroutine(GetEnumerator()); } } else { TargetBlockImage.gameObject.SetActive(false); IngredientsCountImage.SetActive(false); } }
public void OnappMatch() { NazadButton.gameObject.SetActive(false);// GetMoveLayer.gameObject.SetActive(true); GetMoveLayer.loadMove(false); TextAsset text = (TextAsset)Resources.Load("" + currentlvl); if (text == null) { text = Resources.Load("" + currentlvl) as TextAsset; } openLeveltxt(text.text); blocksp = new Block[MaxX * MaxY];// for (int row = 0; row < MaxY; row++) { for (int col = 0; col < MaxX; col++) { Createblock(col, row); } } bblocks = new Block[8 * 9]; for (int row = 0; row < 8; row++) { for (int col = 0; col < 9; col++) { GameObject vblck = ((GameObject)Instantiate(blockpref, vector3position + new Vector2(col * blckWH(), row * blckWH()), Quaternion.identity)); vblck.transform.SetParent(LevelParent.transform); bblocks[row * 9 + col] = vblck.GetComponent <Block>(); vblck.GetComponent <Block>().row = row; vblck.GetComponent <Block>().col = col; vblck.GetComponent <Block>().types = 2; } } GetMoveLayer.restarting(); OpLvl.THIS.gameObject.SetActive(false); NextImage.gameObject.SetActive(false); if (modeLvl == 3) { TargetBlockImage.gameObject.SetActive(true); IngredientsCountImage.SetActive(false); } else if (modeLvl == 2) { TargetBlockImage.gameObject.SetActive(false); IngredientsCountImage.SetActive(true); IngredientsCountImage2.SetActive(true); GetMoveLayer.IngredientPosition(ingCtar[0], ingCtar[1]); GetText2.gameObject.SetActive(false); } else if (modeLvl == 1) { TargetBlockImage.gameObject.SetActive(false); IngredientsCountImage.SetActive(true); IngredientsCountImage2.SetActive(true); GetText2.gameObject.SetActive(false); IngredientsCountImage.GetComponent <Image>().sprite = GetSpritesFromItem[(int)collectItems[0]]; IngredientsCountImage2.GetComponent <Image>().sprite = GetSpritesFromItem[(int)collectItems[1]]; if ((uint)ltype == 1 && GetMoveLayer.state == 0) { ISNULL = false; if (invoker == false) { InvokeRepeating("RunTimer", 1, 1); } } } else { TargetBlockImage.gameObject.SetActive(false); IngredientsCountImage.SetActive(false); } if ((uint)ltype == 1) { GetTextTimer.text = "" + 60; GetMoveLayer.limitMove = 1; } print(modeLvl); }