Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Latest commit

 

History

History
44 lines (34 loc) · 1.12 KB

File metadata and controls

44 lines (34 loc) · 1.12 KB

Creating Custom ICubeBehaviors

  1. Create a class that inherits from MonoBehavior and ICustomCubeBehaviour

  2. Add a constructor that takes in an IntPtr and passes it to the base constructor

    public MyCustomCubeBehavior(System.IntPtr ptr) : base(ptr)
    {
    
    }
  3. Add these methods to your class

    public void OnFragmentInitialized(CubeBase fragmentCubeBase)
    {
        
    }
    public void OnCollideWithCube(CubeBase colCubeBase) 
    {
        
    }
  4. At the end the class should look like this

    public class MyCustomCubeBehavior : MonoBehaviour, ICustomCubeBehaviour
    {
        public MyCustomCubeBehavior(System.IntPtr ptr) : base(ptr){}

        public void OnFragmentInitialized(CubeBase fragmentCubeBase)
        {
            
        }
        public void OnCollideWithCube(CubeBase colCubeBase) 
        {
            
        }
    }
  
  1. Add this to OnApplicationStart if you haven't already (make sure you add this after PMFSystem.EnableSystem<PMFHelper>();)
    PMFHelper.AutoInject(System.Reflection.Assembly.GetExecutingAssembly());