Exemple #1
0
        static UJCollision GetCollision(GameObject gameObject)
        {
            UJCollision trgr = gameObject.GetComponent <UJCollision>();

            if (trgr == null)
            {
                trgr = gameObject.AddComponent <UJCollision>();
            }

            trgr.hideFlags = HideFlags.HideInInspector;
            return(trgr);
        }
Exemple #2
0
        public static void OnCollisionExit(this Rigidbody rigidbody, Action <Collision> trigger)
        {
            UJCollision trgr = GetCollision(rigidbody.gameObject);

            trgr.exit = trigger;
        }
Exemple #3
0
        public static void OnCollisionExit(this Collider col, Action <Collision> trigger)
        {
            UJCollision trgr = GetCollision(col.gameObject);

            trgr.exit = trigger;
        }