예제 #1
0
        public static void DeleteReferencesToObject(Animatable obj)
        {
            var deleteKeys = new List <int>(Intersections.Count);

            for (int i = Intersections.Count - 1; i >= 0; --i)
            {
                if (Intersections[i].Item3.GetInstanceID() == obj.GetInstanceID())
                {
                    OnIntersectionEnd?.Invoke(Intersections[i]);
                    Intersections.RemoveAt(i);
                }
            }
        }
예제 #2
0
        public static void OnHandObjectCollisionEnd(Animatable other, GameObject handPart)
        {
            HandType hand; HandJoint joint;

            GetJointFromGameobjectName(handPart.name, out hand, out joint);
            if (hand == HandType.Max)
            {
                return;
            }

            var tpl = new Tuple <HandType, HandJoint, Animatable>(hand, joint, other);

            if (Intersections.Remove(tpl) == false)
            {
                Debug.LogWarning("Collision-end detected on an object without collision-start.");
            }
            else
            {
                OnIntersectionEnd?.Invoke(tpl);
            }
        }