Beispiel #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            GUI.enabled = Application.isPlaying;

            ScriptableString scriptableString = target as ScriptableString;

            if (GUILayout.Button("On Value Changed"))
            {
                scriptableString.OnValueChanged();
            }
        }
Beispiel #2
0
        public override void OnInspectorGUI()
        {
            ScriptableString scriptableString = target as ScriptableString;

            // If the item has not had its value initialized, set the name of the asset as the value (as a convenience function)
            if (scriptableString.DefaultValue == null && !string.IsNullOrEmpty(target.name))
            {
                SerializedProperty defaultValueProp = serializedObject.FindProperty("DefaultValue");

                defaultValueProp.stringValue = target.name;
                serializedObject.ApplyModifiedProperties();
            }

            base.OnInspectorGUI();
        }