// Use this for initialization
 void Start()
 {
     fix = gameObject.AddComponent<LPFixturePoly>();
     fix.DefinePoints(Points);
     bod = GetComponent<LPBody>();
     bod.Initialise(FindObjectOfType<LPManager>());
 }
 void Start()
 {
     bod = GetComponent<LPBody>();
     lpman = FindObjectOfType<LPManager>();
     if (lpman.UseContactListener == false)
     {
         Debug.LogError("This body destroyer needs 'Use Contact Listener' in the LPManager component in this scene to be set to reue in order to work");
     }
 }
示例#3
0
    /// <summary>Create this fixture in the simulation</summary>								
    public virtual void Initialise(LPBody bod)
    {
        body = bod;
        myIndex = body.AddFixture(this);
        GetPhysProps();

        IntPtr shape = GetShape();

        ThingPtr = LPAPIFixture.AddFixture(body.GetPtr(),(int)Shapetype
                                           ,shape
                                           ,Density,actualFriction,actualRestitution,IsSensor,myIndex);

        LPAPIFixture.SetFixtureFilterData(ThingPtr,(Int16)CollisionGroupIndex,categoryBits,maskBits);
    }
 // Use this for initialization
 void Start()
 {
     partsys = FindObjectOfType<LPParticleSystem>();
     bod = GetComponent<LPBody>();
 }
 void Start()
 {
     lpman = FindObjectOfType<LPManager>();
     bod  = GetComponent<LPBody>();
 }
示例#6
0
 /// <summary>
 /// Pass an LPBody in here after creation to add it to the list of all the bodies in the world and assign it an index</summary>
 public int AddBody(LPBody body)
 {
     allBodies.Add(bodiesIndex,body);
     bodiesIndex++;
     return bodiesIndex -1;
 }