コード例 #1
0
ファイル: BombPiece.cs プロジェクト: IoT-Experts/Panda
    public override bool matchConditions(int xPos, int yPos, List <Board> linkedCubesX, List <Board> linkedCubesY, List <Board> linkedCubesTRBL, List <Board> linkedCubesTLBR)
    {
        int chainMatch = 0; // how many chain are making a cross...

        if (linkedCubesX.Count > 1)
        {
            chainMatch++;
        }
        if (linkedCubesY.Count > 1)
        {
            chainMatch++;
        }
        if (linkedCubesTLBR.Count > 1)
        {
            chainMatch++;
        }
        if (linkedCubesTRBL.Count > 1)
        {
            chainMatch++;
        }
        if (chainMatch > 1)
        {                                                // + or T or L-type match special pieces
            gm.board[xPos, yPos].convertToSpecial(this); // makes the cube a special piece
            gm.board[xPos, yPos].panelHit();

            //lock the piece for just created power piece
            gm.lockJustCreated(xPos, yPos, 0.3f);
            GP_TrayBasket trayBasket = FindObjectOfType <GP_TrayBasket>();
            StartCoroutine(trayBasket.AddBasket(2, gm.board[xPos, yPos].position, 0));
            return(true);
        }
        return(false);
    }
コード例 #2
0
ファイル: admodads.cs プロジェクト: IoT-Experts/Panda
 void Start()
 {
     Vungle.init(idVungle, "", "");
     trayBasket = FindObjectOfType <GP_TrayBasket>();
     Box.gameObject.SetActive(false);
     Box.onClick.AddListener(() => showads());
     check            = false;
     rewardBasedVideo = RewardBasedVideoAd.Instance;
     RequestInterstitial();
     RequestBanner();
 }
コード例 #3
0
    public override bool matchConditions(int xPos, int yPos, List <Board> linkedCubesX, List <Board> linkedCubesY, List <Board> linkedCubesTRBL, List <Board> linkedCubesTLBR)
    {
        if (linkedCubesY.Count > 2)
        {                                                // 4 match in a row
            gm.board[xPos, yPos].convertToSpecial(this); // makes the cube a special piece
            gm.board[xPos, yPos].panelHit();

            //lock the piece for just created power piece
            gm.lockJustCreated(xPos, yPos, 0.3f);
            GP_TrayBasket trayBasket = FindObjectOfType <GP_TrayBasket>();
            StartCoroutine(trayBasket.AddBasket(1, gm.board[xPos, yPos].position, 0));
            return(true);
        }
        return(false);
    }
コード例 #4
0
 public void RemoveCountBasket(int i)
 {
     if (count > 0)
     {
         count -= i;
         anim.SetTrigger("scale");
         txtCount.text = count.ToString();
     }
     if (count <= 0)
     {
         GP_TrayBasket trayBasket = FindObjectOfType <GP_TrayBasket>();
         trayBasket.basketCurrent[index].GetComponent <GP_Basket1>().active = false;
         GP_TrayBasket.SoluongBasket--;
         Destroy(gameObject);
     }
 }