コード例 #1
0
			internal virtual void Reset(PluginImporterInspector inspector)
			{
				string platformData = inspector.importer.GetPlatformData(this.platformName, this.key);
				try
				{
					this.value = TypeDescriptor.GetConverter(this.type).ConvertFromString(platformData);
				}
				catch
				{
					this.value = this.defaultValue;
					if (!string.IsNullOrEmpty(platformData))
					{
						Debug.LogWarning(string.Concat(new object[]
						{
							"Failed to parse value ('",
							platformData,
							"') for ",
							this.key,
							", platform: ",
							this.platformName,
							", type: ",
							this.type,
							". Default value will be set '",
							this.defaultValue,
							"'"
						}));
					}
				}
			}
コード例 #2
0
 protected void ParseStringValue(PluginImporterInspector inspector, string valueString, bool muteWarnings = false)
 {
     try
     {
         this.value = TypeDescriptor.GetConverter(this.type).ConvertFromString(valueString);
     }
     catch
     {
         this.value = this.defaultValue;
         if (!muteWarnings && !string.IsNullOrEmpty(valueString))
         {
             if (inspector.importer.GetCompatibleWithPlatform(this.platformName))
             {
                 Debug.LogWarning(string.Concat(new object[]
                 {
                     "Failed to parse value ('",
                     valueString,
                     "') for ",
                     this.key,
                     ", platform: ",
                     this.platformName,
                     ", type: ",
                     this.type,
                     ". Default value will be set '",
                     this.defaultValue,
                     "'"
                 }));
             }
         }
     }
 }
コード例 #3
0
            internal virtual void Reset(PluginImporterInspector inspector)
            {
                string platformData = inspector.importer.GetPlatformData(this.platformName, this.key);

                try
                {
                    this.value = TypeDescriptor.GetConverter(this.type).ConvertFromString(platformData);
                }
                catch
                {
                    this.value = this.defaultValue;
                    if (!string.IsNullOrEmpty(platformData))
                    {
                        Debug.LogWarning(string.Concat(new object[]
                        {
                            "Failed to parse value ('",
                            platformData,
                            "') for ",
                            this.key,
                            ", platform: ",
                            this.platformName,
                            ", type: ",
                            this.type,
                            ". Default value will be set '",
                            this.defaultValue,
                            "'"
                        }));
                    }
                }
            }
コード例 #4
0
 public virtual void Apply(PluginImporterInspector inspector)
 {
   if (!this.propertiesRefreshed)
     return;
   foreach (DefaultPluginImporterExtension.Property property in this.properties)
     property.Apply(inspector);
 }
コード例 #5
0
 protected virtual void RefreshProperties(PluginImporterInspector inspector)
 {
     foreach (var p in properties)
     {
         p.Reset(inspector);
     }
     propertiesRefreshed = true;
 }
コード例 #6
0
 protected virtual void RefreshProperties(PluginImporterInspector inspector)
 {
     foreach (DefaultPluginImporterExtension.Property property in this.properties)
     {
         property.Reset(inspector);
     }
     this.propertiesRefreshed = true;
 }
コード例 #7
0
 public virtual void Apply(PluginImporterInspector inspector)
 {
     if (this.propertiesRefreshed)
     {
         foreach (Property property in this.properties)
         {
             property.Apply(inspector);
         }
     }
 }
コード例 #8
0
 protected virtual void RefreshProperties(PluginImporterInspector inspector)
 {
     DefaultPluginImporterExtension.Property[] array = this.properties;
     for (int i = 0; i < array.Length; i++)
     {
         DefaultPluginImporterExtension.Property property = array[i];
         property.Reset(inspector);
     }
     this.propertiesRefreshed = true;
 }
コード例 #9
0
 public virtual void Apply(PluginImporterInspector inspector)
 {
     if (!this.propertiesRefreshed)
     {
         return;
     }
     foreach (DefaultPluginImporterExtension.Property property in this.properties)
     {
         property.Apply(inspector);
     }
 }
コード例 #10
0
 public virtual void OnPlatformSettingsGUI(PluginImporterInspector inspector)
 {
   if (!this.propertiesRefreshed)
     this.RefreshProperties(inspector);
   EditorGUI.BeginChangeCheck();
   foreach (DefaultPluginImporterExtension.Property property in this.properties)
     property.OnGUI(inspector);
   if (!EditorGUI.EndChangeCheck())
     return;
   this.hasModified = true;
 }
コード例 #11
0
        public virtual void Apply(PluginImporterInspector inspector)
        {
            if (!propertiesRefreshed)
            {
                return;
            }

            foreach (var p in properties)
            {
                p.Apply(inspector);
            }
        }
コード例 #12
0
 public virtual void Apply(PluginImporterInspector inspector)
 {
     if (this.propertiesRefreshed)
     {
         DefaultPluginImporterExtension.Property[] array = this.properties;
         for (int i = 0; i < array.Length; i++)
         {
             DefaultPluginImporterExtension.Property property = array[i];
             property.Apply(inspector);
         }
     }
 }
コード例 #13
0
        internal override void OnGUI(PluginImporterInspector inspector)
        {
            bool flag = false;

            EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins, new GUILayoutOption[0]);
            GUILayout.Label("Framework dependencies", EditorStyles.boldLabel, new GUILayoutOption[0]);
            EditorGUI.BeginChangeCheck();
            foreach (KeyValuePair <string, bool> pair in this.m_isFrequentEnabled)
            {
                this.m_isFrequentEnabled[pair.Key] = GUILayout.Toggle(pair.Value, pair.Key, new GUILayoutOption[0]);
            }
            if (EditorGUI.EndChangeCheck())
            {
                flag = true;
            }
            this.m_isDefaultVisible = EditorGUILayout.Foldout(this.m_isDefaultVisible, this.GetDefaultFrameworksLabel(), true);
            if (this.m_isDefaultVisible)
            {
                EditorGUI.indentLevel++;
                using (new EditorGUI.DisabledScope(true))
                {
                    foreach (string str in this.m_defaultFrameworks)
                    {
                        GUILayout.Toggle(true, str, new GUILayoutOption[0]);
                    }
                }
                EditorGUI.indentLevel--;
            }
            this.m_isRareVisible = EditorGUILayout.Foldout(this.m_isRareVisible, this.GetRareFrameworksLabel(), true);
            if (this.m_isRareVisible)
            {
                EditorGUI.indentLevel++;
                EditorGUI.BeginChangeCheck();
                foreach (KeyValuePair <string, bool> pair2 in this.m_isRareEnabled)
                {
                    this.m_isRareEnabled[pair2.Key] = GUILayout.Toggle(pair2.Value, pair2.Key, new GUILayoutOption[0]);
                }
                if (EditorGUI.EndChangeCheck())
                {
                    flag = true;
                }
                EditorGUI.indentLevel--;
            }
            GUILayout.EndVertical();
            this.UpdateValue();
            GUI.changed = flag;
        }
コード例 #14
0
        public virtual void OnPlatformSettingsGUI(PluginImporterInspector inspector)
        {
            if (!propertiesRefreshed)
            {
                RefreshProperties(inspector);
            }

            EditorGUI.BeginChangeCheck();
            foreach (var p in properties)
            {
                p.OnGUI(inspector);
            }
            if (EditorGUI.EndChangeCheck())
            {
                hasModified = true;
            }
        }
コード例 #15
0
 public virtual void OnPlatformSettingsGUI(PluginImporterInspector inspector)
 {
     if (!this.propertiesRefreshed)
     {
         this.RefreshProperties(inspector);
     }
     EditorGUI.BeginChangeCheck();
     foreach (DefaultPluginImporterExtension.Property property in this.properties)
     {
         property.OnGUI(inspector);
     }
     if (!EditorGUI.EndChangeCheck())
     {
         return;
     }
     this.hasModified = true;
 }
コード例 #16
0
 public virtual void OnPlatformSettingsGUI(PluginImporterInspector inspector)
 {
     if (!this.propertiesRefreshed)
     {
         this.RefreshProperties(inspector);
     }
     EditorGUI.BeginChangeCheck();
     DefaultPluginImporterExtension.Property[] array = this.properties;
     for (int i = 0; i < array.Length; i++)
     {
         DefaultPluginImporterExtension.Property property = array[i];
         property.OnGUI(inspector);
     }
     if (EditorGUI.EndChangeCheck())
     {
         this.hasModified = true;
     }
 }
コード例 #17
0
            internal virtual void Reset(PluginImporterInspector inspector)
            {
                string platformData = inspector.importer.GetPlatformData(this.platformName, this.key);

                try
                {
                    this.value = TypeDescriptor.GetConverter(this.type).ConvertFromString(platformData);
                }
                catch
                {
                    this.value = this.defaultValue;
                    if (string.IsNullOrEmpty(platformData))
                    {
                        return;
                    }
                    Debug.LogWarning((object)("Failed to parse value ('" + platformData + "') for " + this.key + ", platform: " + this.platformName + ", type: " + (object)this.type + ". Default value will be set '" + this.defaultValue + "'"));
                }
            }
コード例 #18
0
 internal virtual void OnGUI(PluginImporterInspector inspector)
 {
     if (type == typeof(bool))
     {
         value = EditorGUILayout.Toggle(name, (bool)value);
     }
     else if (type.IsEnum)
     {
         value = EditorGUILayout.EnumPopup(name, (Enum)value);
     }
     else if (type == typeof(string))
     {
         value = EditorGUILayout.TextField(name, (string)value);
     }
     else
     {
         throw new NotImplementedException("Don't know how to display value.");
     }
 }
コード例 #19
0
 internal virtual void OnGUI(PluginImporterInspector inspector)
 {
     if (this.type == typeof(bool))
     {
         this.value = EditorGUILayout.Toggle(this.name, (bool)this.value, new GUILayoutOption[0]);
     }
     else if (this.type.IsEnum)
     {
         this.value = EditorGUILayout.EnumPopup(this.name, (Enum)this.value, new GUILayoutOption[0]);
     }
     else
     {
         if (this.type != typeof(string))
         {
             throw new NotImplementedException("Don't know how to display value.");
         }
         this.value = EditorGUILayout.TextField(this.name, (string)this.value, new GUILayoutOption[0]);
     }
 }
コード例 #20
0
            protected void ParseStringValue(PluginImporterInspector inspector, string valueString, bool muteWarnings = false)
            {
                try
                {
                    value = TypeDescriptor.GetConverter(type).ConvertFromString(valueString);
                }
                catch
                {
                    value = defaultValue;

                    if (!muteWarnings && !string.IsNullOrEmpty(valueString))
                    {
                        // We mute warnings for properties that are on disabled platforms to avoid unnecessary spam for deprecated values, case 909247
                        if (inspector.importer.GetCompatibleWithPlatform(platformName))
                        {
                            Debug.LogWarning("Failed to parse value ('" + valueString + "') for " + key + ", platform: " + platformName + ", type: " + type + ". Default value will be set '" + defaultValue + "'");
                        }
                    }
                }
            }
コード例 #21
0
 internal override void OnGUI(PluginImporterInspector inspector)
 {
     if (!((PluginImporter)inspector.target).isNativePlugin)
     {
         this.selectedIndex = EditorGUILayout.Popup(base.name, this.selectedIndex, this.placeHolders, new GUILayoutOption[0]);
         if ((this.selectedIndex >= 0) && (this.selectedIndex < this.placeHolders.Length))
         {
             string text = this.placeHolders[this.selectedIndex].text;
             if (text == "(none)")
             {
                 this.selectedIndex = -1;
                 text = "";
             }
             base.value = text;
         }
         else
         {
             base.value = "";
         }
     }
 }
コード例 #22
0
        internal override void Reset(PluginImporterInspector inspector)
        {
            base.Reset(inspector);
            string platformData = inspector.importer.GetPlatformData(base.platformName, base.key);

            this.ResetValues();
            char[]   separator = new char[] { ';' };
            string[] strArray  = platformData.Split(separator);
            foreach (string str2 in strArray)
            {
                if (this.m_isFrequentEnabled.ContainsKey(str2))
                {
                    this.m_isFrequentEnabled[str2] = true;
                }
                else if (this.m_isRareEnabled.ContainsKey(str2))
                {
                    this.m_isRareEnabled[str2] = true;
                }
                else if (str2 != "")
                {
                    this.m_userFrameworks.Add(str2);
                }
            }
        }
コード例 #23
0
 public virtual void OnDisable(PluginImporterInspector inspector)
 {
 }
コード例 #24
0
 public virtual bool HasModified(PluginImporterInspector inspector)
 {
     return(this.hasModified);
 }
コード例 #25
0
 public virtual void OnEnable(PluginImporterInspector inspector)
 {
     this.RefreshProperties(inspector);
 }
コード例 #26
0
 internal override void Reset(PluginImporterInspector inspector)
 {
     base.Reset(inspector);
     this._placeHolders = null;
     this.ResolveIndex();
 }
コード例 #27
0
 public virtual void ResetValues(PluginImporterInspector inspector)
 {
     this.hasModified = false;
     this.RefreshProperties(inspector);
 }
コード例 #28
0
		public virtual void Apply(PluginImporterInspector inspector)
		{
			if (!this.propertiesRefreshed)
			{
				return;
			}
			DefaultPluginImporterExtension.Property[] array = this.properties;
			for (int i = 0; i < array.Length; i++)
			{
				DefaultPluginImporterExtension.Property property = array[i];
				property.Apply(inspector);
			}
		}
コード例 #29
0
 public virtual void OnDisable(PluginImporterInspector inspector)
 {
 }
コード例 #30
0
            internal virtual void Reset(PluginImporterInspector inspector)
            {
                string valueString = inspector.importer.GetPlatformData(platformName, key);

                ParseStringValue(inspector, valueString);
            }
コード例 #31
0
 internal virtual void Apply(PluginImporterInspector inspector)
 {
   inspector.importer.SetPlatformData(this.platformName, this.key, this.value.ToString());
 }
コード例 #32
0
 public virtual void ResetValues(PluginImporterInspector inspector)
 {
   this.hasModified = false;
   this.RefreshProperties(inspector);
 }
コード例 #33
0
 internal virtual void OnGUI(PluginImporterInspector inspector)
 {
   if (this.type == typeof (bool))
     this.value = (object) EditorGUILayout.Toggle(this.name, (bool) this.value, new GUILayoutOption[0]);
   else if (this.type.IsEnum)
   {
     this.value = (object) EditorGUILayout.EnumPopup(this.name, (Enum) this.value, new GUILayoutOption[0]);
   }
   else
   {
     if (this.type != typeof (string))
       throw new NotImplementedException("Don't know how to display value.");
     this.value = (object) EditorGUILayout.TextField(this.name, (string) this.value, new GUILayoutOption[0]);
   }
 }
コード例 #34
0
 public virtual bool HasModified(PluginImporterInspector inspector)
 {
   return this.hasModified;
 }
コード例 #35
0
            internal virtual void Reset(PluginImporterInspector inspector)
            {
                string platformData = inspector.importer.GetPlatformData(this.platformName, this.key);

                this.ParseStringValue(platformData);
            }
コード例 #36
0
 public virtual void OnEnable(PluginImporterInspector inspector)
 {
   this.RefreshProperties(inspector);
 }
コード例 #37
0
		protected virtual void RefreshProperties(PluginImporterInspector inspector)
		{
			DefaultPluginImporterExtension.Property[] array = this.properties;
			for (int i = 0; i < array.Length; i++)
			{
				DefaultPluginImporterExtension.Property property = array[i];
				property.Reset(inspector);
			}
			this.propertiesRefreshed = true;
		}
コード例 #38
0
            internal virtual void Apply(PluginImporterInspector inspector)
            {
                string valueString = type == typeof(bool) ? value.ToString().ToLower() : value.ToString();

                inspector.importer.SetPlatformData(platformName, key, valueString);
            }
コード例 #39
0
		public virtual void OnPlatformSettingsGUI(PluginImporterInspector inspector)
		{
			if (!this.propertiesRefreshed)
			{
				this.RefreshProperties(inspector);
			}
			EditorGUI.BeginChangeCheck();
			DefaultPluginImporterExtension.Property[] array = this.properties;
			for (int i = 0; i < array.Length; i++)
			{
				DefaultPluginImporterExtension.Property property = array[i];
				property.OnGUI(inspector);
			}
			if (EditorGUI.EndChangeCheck())
			{
				this.hasModified = true;
			}
		}
コード例 #40
0
 internal virtual void Reset(PluginImporterInspector inspector)
 {
   string platformData = inspector.importer.GetPlatformData(this.platformName, this.key);
   try
   {
     this.value = TypeDescriptor.GetConverter(this.type).ConvertFromString(platformData);
   }
   catch
   {
     this.value = this.defaultValue;
     if (string.IsNullOrEmpty(platformData))
       return;
     Debug.LogWarning((object) ("Failed to parse value ('" + platformData + "') for " + this.key + ", platform: " + this.platformName + ", type: " + (object) this.type + ". Default value will be set '" + this.defaultValue + "'"));
   }
 }
コード例 #41
0
 internal virtual void Apply(PluginImporterInspector inspector)
 {
     inspector.importer.SetPlatformData(this.platformName, this.key, this.value.ToString());
 }
コード例 #42
0
 protected virtual void RefreshProperties(PluginImporterInspector inspector)
 {
   foreach (DefaultPluginImporterExtension.Property property in this.properties)
     property.Reset(inspector);
   this.propertiesRefreshed = true;
 }