示例#1
0
 /// <summary>
 /// Creates an instance of Tags.
 /// </summary>
 /// <param name="tags">Tags collection to copy.</param>
 public Tags(Tags tags) : this()
 {
     if (tags == null) return;
     foreach (var tag in tags.tagList)
     {
         AddTag(tag);
     }
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TouchPoint"/> class.
        /// </summary>
        /// <param name="id">Unique id of the touch.</param>
        /// <param name="position">Screen position of the touch.</param>
        /// <param name="tags">Initial tags.</param>
        internal TouchPoint(int id, Vector2 position, Tags tags)
        {
            Id = id;
            this.position = PreviousPosition = newPosition = position;

            Tags = tags ?? new Tags();
            properties = new Dictionary<string, object>();
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TouchPoint"/> class.
        /// </summary>
        /// <param name="id">Unique id of the touch.</param>
        /// <param name="position">Screen position of the touch.</param>
        /// <param name="tags">Initial tags.</param>
        /// <param name="properties">Initial properties.</param>
        internal TouchPoint(int id, Vector2 position, Tags tags, IDictionary<string, object> properties)
        {
            Id = id;
            Position = position;
            PreviousPosition = position;

            Tags = tags ?? new Tags();
            this.properties = (properties == null) ? new Dictionary<string, object>() : new Dictionary<string, object>(properties);
        }
示例#4
0
 /// <summary>
 /// Creates an instance of Tags.
 /// </summary>
 /// <param name="tags">Tags collection to copy.</param>
 public Tags(Tags tags)
     : this()
 {
     if (tags == null) return;
     var count = tags.tagList.Count;
     for (var i = 0; i < count; i++)
     {
         AddTag(tags.tagList[i]);
     }
 }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Tags"/> class.
        /// </summary>
        /// <param name="tags"> Tags to copy. </param>
        /// <param name="add"> Tags to add. </param>
        public Tags(Tags tags, IEnumerable<string> add) : this(tags)
        {
            if (add == null) return;
            foreach (var tag in add)
            {
                if (string.IsNullOrEmpty(tag)) continue;
                this.tags.Add(tag);
            }
#if UNITY_EDITOR
            syncTagList();
#endif
        }
 internal TouchPoint INTERNAL_BeginTouch(Vector2 position, IInputSource input, Tags tags)
 {
     TouchPoint touch;
     lock (touchLock)
     {
         touch = touchPointPool.Get();
         touch.INTERNAL_Init(nextTouchId++, position, input, tags);
         touchesBegan.Add(touch);
     }
     return touch;
 }
示例#7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Tags"/> class.
        /// </summary>
        /// <param name="tags"> Tags to copy. </param>
        public Tags(Tags tags) : this()
        {
            if (tags == null) return;
            foreach (var tag in tags.tags) this.tags.Add(tag);
#if UNITY_EDITOR
            syncTagList();
#endif
        }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Tags"/> class.
 /// </summary>
 /// <param name="tags"> Tags to copy. </param>
 /// <param name="add"> Tag to add. </param>
 public Tags(Tags tags, string add) : this(tags)
 {
     if (string.IsNullOrEmpty(add)) return;
     this.tags.Add(add);
 }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TouchPoint"/> class.
 /// </summary>
 /// <param name="id">Unique id of the touch.</param>
 /// <param name="position">Screen position of the touch.</param>
 /// <param name="tags">Initial tags.</param>
 internal void INTERNAL_Init(int id, Vector2 position, Tags tags)
 {
     Id = id;
     this.position = PreviousPosition = newPosition = position;
     isDirty = true;
     Tags = tags ?? new Tags();
 }
 internal ITouch INTERNAL_BeginTouch(Vector2 position, Tags tags)
 {
     TouchPoint touch;
     lock (touchesBegan)
     {
         touch = touchPointPool.Get();
         touch.INTERNAL_Init(nextTouchId++, position, tags);
         touchesBegan.Add(touch);
     }
     return touch;
 }
示例#11
0
 internal ITouch BeginTouch(Vector2 position, Tags tags)
 {
     TouchPoint touch;
     lock (touchesBegan)
     {
         touch = new TouchPoint(nextTouchId++, position, tags);
         touchesBegan.Add(touch);
     }
     return touch;
 }
示例#12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TouchPoint" /> class.
 /// </summary>
 /// <param name="id">Unique id of the touch.</param>
 /// <param name="position">Screen position of the touch.</param>
 /// <param name="input">Input source which created this touch.</param>
 /// <param name="tags">Initial tags.</param>
 internal void INTERNAL_Init(int id, Vector2 position, IInputSource input, Tags tags)
 {
     Id = id;
     InputSource = input;
     this.position = PreviousPosition = newPosition = position;
     Tags = tags ?? Tags.EMPTY;
 }
 /// <inheritdoc />
 public int BeginTouch(Vector2 position, Tags tags, IDictionary<string, System.Object> properties)
 {
     TouchPoint touch;
     lock (touchesBegan)
     {
         touch = new TouchPoint(nextTouchId++, position, tags, properties);
         touchesBegan.Add(touch);
     }
     return touch.Id;
 }
 /// <inheritdoc />
 public int BeginTouch(Vector2 position, Tags tags)
 {
     return BeginTouch(position, tags, null);
 }
 /// <inheritdoc />
 public int BeginTouch(Vector2 position, Tags tags)
 {
     return(BeginTouch(position, tags, null));
 }