예제 #1
0
    private void AddDeletionModeButton()
    {
        GameObject newButton = Instantiate(buttonPrefab);

        newButton.transform.SetParent(deletionModePanel);

        LevelEditorButton levelEditorButton = newButton.GetComponent <LevelEditorButton>();

        levelEditorButton.SetupPrefab("Deletion Mode", deletionModePanel);

        levelEditorButton.gameObject.GetComponent <Button>().onClick.AddListener(delegate { InterfaceButtonHandler.GetInstance().onDeleteSelection(); InterfaceManager.GetInstance().OnButtonPressed(levelEditorButton); });
    }
예제 #2
0
    private void AddSaveLevelButton()
    {
        GameObject newButton = Instantiate(levelManagementButtonPrefab);

        newButton.transform.SetParent(saveLevelPanel);

        LevelEditorButton levelEditorButton = newButton.GetComponent <LevelEditorButton>();

        levelEditorButton.SetupConfigLevelButton("Save Level", saveLevelPanel);

        levelEditorButton.gameObject.GetComponent <Button>().onClick.AddListener(delegate { InterfaceButtonHandler.GetInstance().OnSaveLevel(); InterfaceManager.GetInstance().OnButtonPressed(levelEditorButton); });
    }
예제 #3
0
    private void AddPrefabButtons(List <IPlacedObject> placedObjects, Transform panel)
    {
        foreach (IPlacedObject plObject in placedObjects)
        {
            GameObject newButton = Instantiate(buttonPrefab);
            newButton.transform.SetParent(panel);

            LevelEditorButton levelEditorButton = newButton.GetComponent <LevelEditorButton>();
            levelEditorButton.SetupPrefab(plObject.Text, panel);

            levelEditorButton.gameObject.GetComponent <Button>().onClick.AddListener(delegate { InterfaceButtonHandler.GetInstance().PassObjectToPlace(plObject.PrefabId); InterfaceManager.GetInstance().OnButtonPressed(levelEditorButton); });
        }
    }