コード例 #1
0
        public void ResetInfo()
        {
            cardImage.gameObject.GetOrAddComponent <AspectRatioFitter>().aspectRatio             = CardGameManager.Current.CardAspectRatio;
            zoomPanel.GetChild(0).gameObject.GetOrAddComponent <AspectRatioFitter>().aspectRatio = CardGameManager.Current.CardAspectRatio;

            int selectedPropertyIndex = 0;

            PropertyOptions.Clear();
            PropertyOptions.Add(new Dropdown.OptionData()
            {
                text = SetLabel
            });
            DisplayNameLookup.Clear();
            foreach (PropertyDef propDef in CardGameManager.Current.CardProperties)
            {
                string displayName = !string.IsNullOrEmpty(propDef.Display) ? propDef.Display : propDef.Name;
                PropertyOptions.Add(new Dropdown.OptionData()
                {
                    text = displayName
                });
                DisplayNameLookup[displayName] = propDef.Name;
                if (propDef.Name.Equals(CardGameManager.Current.CardPrimaryProperty))
                {
                    selectedPropertyIndex = PropertyOptions.Count - 1;
                }
            }
            propertySelection.options = PropertyOptions;
            propertySelection.value   = selectedPropertyIndex;
            propertySelection.onValueChanged.Invoke(selectedPropertyIndex);
        }
コード例 #2
0
        public void ResetInfo()
        {
            cardImage.gameObject.GetOrAddComponent <AspectRatioFitter>().aspectRatio             = CardGameManager.Current.CardAspectRatio;
            zoomPanel.GetChild(0).gameObject.GetOrAddComponent <AspectRatioFitter>().aspectRatio = CardGameManager.Current.CardAspectRatio;

            PropertyOptions.Clear();
            PropertyOptions.Add(new Dropdown.OptionData()
            {
                text = SetLabel
            });
            DisplayNameLookup.Clear();
            foreach (PropertyDef propertyDef in CardGameManager.Current.CardProperties)
            {
                AddProperty(propertyDef);
            }
            propertySelection.options = PropertyOptions;
            propertySelection.value   = PrimaryPropertyIndex;
            propertySelection.onValueChanged.Invoke(propertySelection.value);
        }