Esempio n. 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)
        {
            string gamepiece;

            for (int i = 0; i < collisionKeyword.Length; i++)
            {
                if (collisionKeyword[i] != null)
                {
                    gamepiece = collisionKeyword[i];
                    if (other.UserObject.ToString().Contains(gamepiece))
                    {
                        bool skip = false;
                        //Debug.Log(other.UserObject.ToString());
                        GameObject tempGamepiece = ((BRigidBody)other.UserObject).gameObject;
                        foreach (GameObject gp in heldGamepieces)
                        {
                            if (gp == tempGamepiece)
                            {
                                skip = true;
                            }
                        }
                        if (!skip)
                        {
                            Debug.Log("does this happen");
                            collisionObject[i]   = tempGamepiece;
                            collisionDetected[i] = true;
                            Debug.Log(collisionObject[i].ToString() + i.ToString());
                        }
                    }
                }
            }
        }
Esempio n. 2
0
 public void BOnCollisionStay(CollisionObject other, BCollisionCallbacksDefault.PersistentManifoldList manifoldList)
 {
 }