Exemplo n.º 1
0
 void UpdateCurDynamicBrick()
 {
     for (int i = 0; i < dynamicBricks.Count; i++)
     {
         DynamicBrick db = dynamicBricks [i];
         db.Update();
     }
 }
Exemplo n.º 2
0
 void UpdateLeaveDynamicBrick()
 {
     for (int i = 0; i < leaveDynamicBricks.Count; i++)
     {
         DynamicBrick db = leaveDynamicBricks [i];
         db.Update();
         if (db.Over)
         {
             pool.Free(db);
             leaveDynamicBricks.Remove(db);
             i--;
         }
     }
 }
Exemplo n.º 3
0
    void DynamicEffect()
    {
        bool leave = player.transform.localPosition.x > curValidateX + 2f;


        for (int i = 0; i < dynamicBricks.Count; i++)
        {
            DynamicBrick db = dynamicBricks [i];
            db.Update();

//			if (player.transform.localPosition.x > db.Go.transform.localPosition.x) {
//				leaveCount++;
//				leaveDynamicBricks.Add (db);
//				SetLeave (db, leaveCount);
//				dynamicBricks.Remove (db);
//				i--;
//			}
        }

        UpdateLeaveDynamicBrick();
        UpdateSimulatorPot();
        leave = true;
        if (leave && dynamicBricks.Count < 20)
        {
            curValidateX = player.transform.localPosition.x;
            int x, y;
            int r = Random.Range(0, 10);
            if (r < 3)
            {
                x = Random.Range(10, 15);
                y = Random.Range(-5, 5);
            }
            else if (r < 6)
            {
                x = Random.Range(3, 8);
                y = Random.Range(-15, -10);
            }
            else
            {
                x = Random.Range(3, 8);
                y = Random.Range(10, 15);
            }
            GenerateBlockBrick(new Vector2(endPot.x, 0), 3, 3, new Vector3(x, y, x), delayTime_Cell * 5, false);
        }
    }