コード例 #1
0
 /// <summary>
 /// Method is called whenever interactor collides with another object.
 /// Checks if the name of the other object contains the keyword of the gamepiece we are looking for and acts if so.
 /// </summary>
 /// <param name="other">The object the interactor collided with</param>
 /// <param name="manifoldList">List of collision manifolds--this isn't used</param>
 public void BOnCollisionEnter(CollisionObject other, BCollisionCallbacksDefault.PersistentManifoldList manifoldList)
 {
     for (int i = 0; i < gamepiece.Count; i++)
     {
         if (other.UserObject.ToString().Contains(gamepiece[i]))
         {
             collisionDetector[i] = true;
             collisionObject.Insert(i, ((BRigidBody)other.UserObject).gameObject);
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Method is called whenever interactor collides with another object.
 /// Checks if the name of the other object contains the keyword of the gamepiece we are looking for and acts if so.
 /// </summary>
 /// <param name="other">The object the interactor collided with</param>
 /// <param name="manifoldList">List of collision manifolds--this isn't used</param>
 public void BOnCollisionEnter(CollisionObject other, BCollisionCallbacksDefault.PersistentManifoldList manifoldList)
 {
     for (int i = 0; i < gamepiece.Count; i++)
     {
         if (other.UserObject.ToString().Contains(gamepiece[i]) && ((BRigidBody)other.UserObject).gameObject.GetComponent <BFixedConstraintEx>() == null) //make sure gamepiece isn't already held - NO STEAL
         {
             collisionDetector[i] = true;
             collisionObject.Insert(i, ((BRigidBody)other.UserObject).gameObject); //insert at index coherent with index of gamepiece in FieldDataHandler.gamepieces
         }
     }
 }
コード例 #3
0
    public override void BOnCollisionEnter(CollisionObject otherObj, BCollisionCallbacksDefault.PersistentManifoldList mList)
    {
        BRigidBody obj = (BRigidBody)otherObj.UserObject;
        GameObject g   = obj.gameObject;

        sza.CollisionHandler(g);

        Debug.Log("Got collision with " + g);

        // We don't do anything if we neither destroy or reinstantiate
    }
コード例 #4
0
 public void BOnCollisionStay(CollisionObject other, BCollisionCallbacksDefault.PersistentManifoldList manifoldList)
 {
     // Not implemented
 }