Esempio n. 1
0
    public void TogglePopup()
    {
        //this one is being closed
        if (activePopup == this)
            activePopup = null;
        //this one is being opened
        else {
            //there's another one open, close it
            if (activePopup != null)
                activePopup.TogglePopup();
            activePopup = this;

            if (!iconContainerInitialized)
                initializeIconContainer();
            else
                resizeAndRepositionIconContainer();
        }
        GameObject iconContainerGameObject = iconContainer.gameObject;
        iconContainerGameObject.SetActive(!iconContainerGameObject.activeSelf);
    }
Esempio n. 2
0
 public void assignPopup(List<GameRuleDesignComponentDescriptor> popupDescriptors, System.Type t)
 {
     //check how many descriptors there are, if there's only 1 we can just pick that one right now
     if (popupDescriptors.Count == 1)
         assignDescriptor(popupDescriptors[0]);
     //otherwise, build the popup using the descriptor list, also give it the type so it can check stuff
     //it will assign the default descriptor
     else {
         componentPopup = GameObject.Instantiate(GameRuleDesigner.instance.ruleDesignPopupPrefab).GetComponent<GameRuleDesignPopup>();
         componentPopup.buildPopup(this, popupDescriptors, t);
     }
 }