示例#1
0
        public bool DoesHaveTrackable(TrackableItem item)
        {
            for (int i = 0; i < trackables.Count; i++)
            {
                if (trackables[i].type.Equals(item.type))
                {
                    return(trackables[i].items.Contains(item));
                }
            }

            return(false);
        }
示例#2
0
        public void AddItemToTrackable(TrackableItem item)
        {
            for (int i = 0; i < trackables.Count; i++)
            {
                if (trackables[i].type.Equals(item.type))
                {
                    trackables[i].items.Add(item);
                    return;
                }
            }

            Debug.LogWarning("There is no trackable list of the type item belongs. " + item.type);
        }
示例#3
0
        public void RemoveItemFromTrackable(TrackableItem item)
        {
            for (int i = 0; i < trackables.Count; i++)
            {
                if (trackables[i].type.Equals(item.type))
                {
                    if (trackables[i].items.Contains(item))
                    {
                        trackables[i].items.Remove(item);
                        return;
                    }
                    else
                    {
                        Debug.LogWarning("Item is not in the list! " + item);
                    }
                }
            }

            Debug.LogWarning("There is no trackable list of the type item belongs " + item.type);
        }