public void DeselectObject()
 {
     if (colorModifierPanel != null)
     {
         Destroy(colorModifierPanel.gameObject);
     }
     colorModifierPanel = null;
     if (modelsModifierPanel != null)
     {
         Destroy(modelsModifierPanel.gameObject);
     }
     modelsModifierPanel = null;
     if (shelvesModifierPanel != null)
     {
         Destroy(shelvesModifierPanel.gameObject);
     }
     shelvesModifierPanel = null;
     if (addonsModifierPanel != null)
     {
         Destroy(addonsModifierPanel.gameObject);
     }
     addonsModifierPanel = null;
     foreach (ObjectSelectionRoundButton button in buttons)
     {
         Destroy(button.gameObject);
     }
     buttons.Clear();
     selectedObject = null;
     Main_OffScreen();
 }
예제 #2
0
    void Awake()
    {
        sudokuBoard = GameObject.FindObjectOfType<SudokuBoard>();
        modPanel = GameObject.FindObjectOfType<ModifierPanel>();

        DontDestroyOnLoad(this.gameObject);
    }
예제 #3
0
    public void startGame()
    {
        sudokuBoard = GameObject.FindObjectOfType<SudokuBoard>();
        modPanel = GameObject.FindObjectOfType<ModifierPanel>();

        modPanel.reset();
        sudokuBoard.instantiateBoard();
        populateBoard(level);
        sudokuBoard.checkBoard();
    }
예제 #4
0
 private void modifierbtn_Click(object sender, EventArgs e)
 {
     if (dondgv.SelectedRows.Count == 0)
     {
         MessageBox.Show("Veuillez sélectionner un don");
         AjouterPanel.BringToFront();
     }
     else
     {
         ModifierPanel.BringToFront();
     }
 }
    public void AddColorModifier()
    {
        // Create Button
        ObjectSelectionRoundButton newButton = Instantiate(colorButtonPrefab);

        newButton.transform.SetParent(mainImage.transform, false);
        float buttonPosition = selectedObjectTextImage.rectTransform.rect.width / 5;

        padding = buttonPosition - newButton.button.image.rectTransform.rect.width;
        newButton.button.image.rectTransform.anchoredPosition = new Vector2(-(buttonPosition + padding / 2) * (buttons.Count), -newButton.button.image.rectTransform.rect.height * 2);
        newButton.button.onClick.AddListener(() => ColorModifierToggle());
        buttons.Add(newButton);

        // Create panel
        colorModifierPanel = Instantiate(colorModifierPanelPrefab);
        colorModifierPanel.transform.SetParent(mainImage.transform, false);
        colorModifierPanel.Setup(newButton, ModifierPanel.ModifierPanelType.color, selectedObject);
    }
예제 #6
0
    // Use this for initialization
    void Start()
    {
        sudokuBoard = GameObject.FindObjectOfType<SudokuBoard>();
        modPanel = GameObject.FindObjectOfType<ModifierPanel>();

        sudokuBoard.instantiateBoard();
        int[] modifiers = createModifiers(4);
        foreach (int mod in modifiers)
        {
            int x = Random.Range(0, 9);
            int y = Random.Range(0, 9);

            while (sudokuBoard.getValue(x, y) - mod < 0 || sudokuBoard.getValue(x, y) - mod > 8)
                x = Random.Range(0, 9);
                y = Random.Range(0, 9);

            sudokuBoard.initializeMod(mod, x, y);
            modPanel.addMod(mod);
        }
    }