Ejemplo n.º 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); });
    }
Ejemplo n.º 2
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); });
        }
    }