예제 #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();
 }
예제 #10
0
 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));
 }