Modification class - GeoPlayerRu/PixPhys-Unofficial-Wiki GitHub Wiki

The Modification class is a class containing the variables and some functions of your modified object.

Functions

Constructor

Class constructor takes name of item and name of original item:

Modification ModItem = new Modfication("Something","Brick");   

Loading resources

Modification class has some functions related to loading resources from the outside.

ModItem.LoadSprite(string Path, int PixelsPerUnit = 10, FilterMode filterMode = FilterMode.Point); // Used for loading sprite
ModItem.LoadTexture(string Path, FilterMode filterMode = FilterMode.Point); // Used for loading texture
ModItem.LoadSound(string path); //Used for loading sound (AudioClip)
// Note that arguments with '=' sign can be omitted.

Instantiating

Actually, this is not really instantiating, for real instantiating you still need this:

Instantiate(someObject)  

but, you can create object inside your code by using this:

physObject = ModItem.CreatePhysicalObject(string name, Sprite sprite); // And this will return gameObject, which you can use in your purposes

Data

See SpawnableData