Пример #1
0
    //init
    public IEnumerator Start()
    {
        //wait for card type manager to be ready
        while ((CardTypeManagerScript.instance == null) || (CardTypeManagerScript.instance.areTypesLoaded() == false))
        {
            yield return(null);
        }

        unsavedChanges = false;                 //there are no changes since we just opened the editor
        XMLDeck openDeck = new XMLDeck();       //create a new deck

        newDeck = true;                         //flag the deck as new

        //default search filter settings
        filter = new DeckEditorFilter();
        filter.searchString = null;
        filter.type         = null;
        filter.sortBy       = DeckEditorFilter.SortingRule.name;
        filter.baseCards    = true;
        filter.moddedCards  = true;

        BroadcastMessage("filterChanged", filter); //report the new filter settings to children
        BroadcastMessage("refresh", openDeck);     //update interfaces

        //give things a few frames to stabilize
        yield return(null);

        yield return(null);

        yield return(null);

        GetComponent <VerticalLayoutGroup>().enabled = false; //disable the layout group on this since it doesnt need to change anymore and its recalculations are slow
    }
 //sets the filter
 public void filterChanged(DeckEditorFilter newFilter)
 {
     filter = newFilter;
 }