public void FollowDrag() { if (surpressDragFollow) { return; } TouchCollider tc = TouchGuiSystem.Instance().GetTouch(fingerId); FollowDragInternal(tc); }
public void FollowDrag() { if (surpressDragFollow) { return; } TouchCollider tc = TouchGuiSystem.Instance().GetTouch(fingerId); if (tc == null) { return; } FollowDragInternal(tc.touch.position); }
// Use this for initialization public virtual void Start() { gameObject.layer = LayerMask.NameToLayer("UI"); TouchGuiSystem.Instance(); c2d = GetComponent <Collider2D>(); //if(buttonImage == null) { buttonImage = GetComponent<Image>(); } if (c2d == null) { Debug.LogWarning("missing Collider2D, is this intentional?"); } else if (!c2d.isTrigger) { Debug.LogWarning(name + " collider is not a trigger, is this intentional?"); } if (image != null) { originalColor = image.color; } GenerateOutlineIfNeeded(); }