コード例 #1
0
        static UJTrigger GetTrigger(GameObject gameObject)
        {
            UJTrigger trgr = gameObject.GetComponent <UJTrigger>();

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

            //	trgr.hideFlags = HideFlags.HideInInspector;
            return(trgr);
        }
コード例 #2
0
        public static void OnTriggerExit(this Rigidbody rigidbody, Action <Collider> trigger)
        {
            UJTrigger trgr = GetTrigger(rigidbody.gameObject);

            trgr.exit = trigger;
        }
コード例 #3
0
        public static void OnTriggerExit(this Collider col, Action <Collider> trigger)
        {
            UJTrigger trgr = GetTrigger(col.gameObject);

            trgr.exit = trigger;
        }