public void Spawn() { nextNum = Randomization.RandomPercentage(); // Debug.Log ("num: " + nextNum); // Debug.Log ("score: " + score); if (score == 0) { sc.AddShape(SelectPrefab.RandomShape(), 1); } if (score == 10) { if (nextNum < 20) { sc.AddShape(SelectPrefab.RandomShape(), 1); } } if (score > 100) { if (nextNum < 30) { sc.AddShape(SelectPrefab.RandomShape(), 1); } } if (score > 250) { if (nextNum < 40) { sc.AddShape(SelectPrefab.RandomShape(), 1); } } if (score > 300 && queues[1].activeSelf == false) { queues [1].SetActive(true); } if (score > 300) { if (nextNum < 25) { sc.AddShape(SelectPrefab.RandomShape(), 1); } if (nextNum < 25) { sc.AddShape(SelectPrefab.RandomShape(), 2); } } if (sc.ShapesQueued.Count == 0) { sc.AddShape(SelectPrefab.RandomShape(), 1); } }
private void btnExport_Click(object sender, EventArgs e) { if (frmListProject.OpenPro != -1) { // Update ProjectShape pro = new ProjectShape(); pro.IDPro = frmListProject.OpenPro; pro.Note = frmOutliner.note; ProjectController.AddProject(pro); Shape sp = new Shape(); sp.ID = root.IdObj; sp.LocationX = root.Point.X; sp.LocationY = root.Point.Y; sp.Witdh = root.Witdh; sp.Height = root.Height; sp.NameShape = root.Name; sp.IDPro = frmListProject.OpenPro; ShapeController.AddShape(sp); foreach (var shape in root.lstObj) { sp.ID = shape.IdObj; sp.LocationX = shape.Point.X; sp.LocationY = shape.Point.Y; sp.Witdh = shape.Witdh; sp.Height = shape.Height; sp.NameShape = shape.Name; sp.IDPro = frmListProject.OpenPro; if (shape.Name == "Curve") { sp.LocationX2 = shape.P2.X; sp.LocationY2 = shape.P2.Y; } ShapeController.AddShape(sp); } Infor t = new Infor(); foreach (var temp in lstRt) { t.ID = Convert.ToInt32(temp.Tag); t.LocationX = temp.Location.X; t.LocationY = temp.Location.Y; t.Witdh = temp.Size.Width; t.Height = temp.Size.Height; t.Description = temp.Text; TextController.AddText(t); } } else { // Add new var lst = ProjectController.getListProject(frmMain.idPro); while (lst.Count() > 0) { frmMain.idPro++; lst = ProjectController.getListProject(frmMain.idPro); } ; ProjectShape pro = new ProjectShape(); pro.IDPro = frmMain.idPro; pro.Note = frmOutliner.note; ProjectController.AddProject(pro); Shape sp = new Shape(); // Lưu root var c = ShapeController.CheckShape(root.IdObj); while (c.Count() > 0) { root.IdObj = root.IdObj + 1; c = ShapeController.CheckShape(root.IdObj); } sp.ID = root.IdObj; sp.LocationX = root.Point.X; sp.LocationY = root.Point.Y; sp.Witdh = root.Witdh; sp.Height = root.Height; sp.NameShape = root.Name; sp.IDPro = pro.IDPro; ShapeController.AddShape(sp); foreach (var shape in root.lstObj) { // Lưu shape var d = ShapeController.CheckShape(shape.IdObj); while (d.Count() > 0) { shape.IdObj = shape.IdObj + 1; d = ShapeController.CheckShape(shape.IdObj); } sp.ID = shape.IdObj; sp.LocationX = shape.Point.X; sp.LocationY = shape.Point.Y; sp.Witdh = shape.Witdh; sp.Height = shape.Height; sp.NameShape = shape.Name; sp.IDPro = pro.IDPro; if (shape.Name == "Curve") { sp.LocationX2 = shape.P2.X; sp.LocationY2 = shape.P2.Y; } ShapeController.AddShape(sp); } Infor t = new Infor(); foreach (var temp in lstRt) { t.ID = Convert.ToInt32(temp.Tag); t.LocationX = temp.Location.X; t.LocationY = temp.Location.Y; t.Witdh = temp.Size.Width; t.Height = temp.Size.Height; t.Description = temp.Text; TextController.AddText(t); } } }