Beispiel #1
0
 public void OnClickRotateGround(GroundBig ground)
 {
     currentGroud = ground;
     if (AssitRotateGo.activeInHierarchy)
     {
         this.ChooseRotatePanel.SetActive(true);
     }
 }
Beispiel #2
0
 public void CheckWater(GroundBig gb)
 {
     if (!IsPassMode)
     {
         gotWaterIndexRecord.Remove(gb.GetIndex());
     }
     gb.ChangeColor();
     gb.hasChecked = true;
     if (gb != groundBigQueue[2] && gb.CanGoUp())
     {
         int upIndex = gb.FindUpIndex();
         if (upIndex >= 0 && !groundBigQueue[upIndex].hasChecked && groundBigQueue[upIndex].CanGoDown())
         {
             CheckWater(groundBigQueue[upIndex]);
         }
     }
     if (gb.CanGoDown())
     {
         int downIndex = gb.FindDownIndex();
         if (downIndex >= 0 && !groundBigQueue[downIndex].hasChecked && groundBigQueue[downIndex].CanGoUp())
         {
             CheckWater(groundBigQueue[downIndex]);
         }
     }
     if (gb.CanGoLeft())
     {
         int leftIndex = gb.FindLeftIndex();
         if (leftIndex >= 0 && !groundBigQueue[leftIndex].hasChecked && groundBigQueue[leftIndex].CanGoRight())
         {
             CheckWater(groundBigQueue[leftIndex]);
         }
     }
     if (gb.CanGoRight())
     {
         int rightIndex = gb.FindRightIndex();
         if (rightIndex >= 0 && !groundBigQueue[rightIndex].hasChecked && groundBigQueue[rightIndex].CanGoLeft())
         {
             CheckWater(groundBigQueue[rightIndex]);
         }
     }
 }
Beispiel #3
0
    void Start()
    {
        for (int i = 0; i < 4; i++)
        {
            GroundLittle gb = Instantiate <GroundLittle>(groundQueue[0]);
            gb.transform.SetParent(groundQueueGrid.transform, false);
            groundQueue.Add(gb);
        }
        for (int i = 0; i < groundQueue.Count; i++)
        {
            groundQueue[i].groundType = (GroundBase.GroundType)BCRandomMaker.GetRandByWeight(CurrentHardLevel);
        }

        for (int i = 0; i < 24; i++)
        {
            GroundBig gb = Instantiate <GroundBig>(groundBigQueue[0]);
            gb.transform.SetParent(groundBigQueue[0].transform.parent, false);
            gb.InitGround(i + 1);
            groundBigQueue.Add(gb);
        }
    }