How is Unitys physics material implemented?

Just so you know exactly what I’m talking about, you right click in the assets window, create new physics material, then you can edit its properties in the inspector and drag it into a component.
I would like to make something similar to this. I am writing a plugin for a liquid physics engine for unity. I would like to be able to make a “liquidType” thing similar to unities physics material.

Unity’s PhysicsMaterial is a native object. So it’s not possible to replicate the exact same thing. However it actually just holds some simple information. For that you can simply derive your class from ScriptableObject which allows you to create a standalone-asset instance of it. For inspector editing there are no special rules, it works as any other object in Unity. If you need a custom inspector you are free to create one.

To create an instance of your class you have to use ScriptableObject.CreateInstance. You have to provide a way (most likely through a MenuItem) to create a new instance of your class at edittime. Once created you have to use the AssetDatabase to actually save it as an asset. Note: you have to use “.asset” as extension. Special extensions are for built-in types only.