void OnEnable() { ProductLookup = ScriptableObject.Instantiate( Resources.Load("Scriptables/product_lookup")) as ProductLookupScriptable; PlaceablesLookup = ScriptableObject.Instantiate( Resources.Load("placeables_lookup")) as PlaceablesLookup; }
//public List<ProductInfo> Products; //public List<CraftingContainerInfo> Containers; //public List<RecipeInfo> Recipes; //public Sprite DefaultSmallIcon; public override void OnInspectorGUI() { serializedObject.Update(); // do we have to do this every time? _lookup = (ProductLookupScriptable)this.serializedObject.targetObject; ProductNames = _lookup.GenerateProductNames(); ContainerNames = _lookup.GenerateContainerNames(); EditorList.Show(serializedObject.FindProperty("Products"), EditorListOption.Buttons | EditorListOption.ListLabel); EditorList.Show(serializedObject.FindProperty("Containers"), EditorListOption.Buttons | EditorListOption.ListLabel); EditorList.Show(serializedObject.FindProperty("Recipes")); //EditorGUI.PropertyField(nameRect, property.FindPropertyRelative("Name"), GUIContent.none); serializedObject.ApplyModifiedProperties(); }