// Start is called before the first frame update
    void Start()
    {
        _point        = transform.GetChild(1).GetComponent <RectTransform>();
        _pointMesh    = transform.GetChild(1).GetComponent <Image>();
        _thumbPosText = transform.GetChild(2).GetComponent <Text>();
        _indexPosText = transform.GetChild(3).GetComponent <Text>();

        thumb = ScriptFind.FindTouchDetection(Finger.thumb);
        thumb.OnTouchStatusChange += delegate(object sender, bool flag)
        {
            _isTouching = flag;
            ChangeDotColor();
        };
        thumb.OnOverlapStatusChange += delegate(object sender, bool flag)
        {
            _isOverlapped = flag;
            ChangeDotColor();
        };
        thumb.OnTouchPositionChange += delegate(object sender, Vector2 touchPos)
        {
            _pointPos.x          = touchPos.x * movScaler;
            _pointPos.y          = touchPos.y * movScaler;
            _point.localPosition = _pointPos;
        };
        thumb.OnTouchPositionChange += delegate(object sender, Vector2 touchPos)
        {
            _thumbPosText.text = "T(mm): " + touchPos;
        };

        index = ScriptFind.FindTouchDetection(Finger.index);
        index.OnTouchPositionChange += delegate(object sender, Vector2 touchPos)
        {
            _indexPosText.text = " I(mm): " + touchPos;
        };
    }
 public StreamDataGenerator(
     IJointMangerAction jointManager,
     IFingerAction thumb,
     IFingerAction indexFinger,
     Camera cam,
     bool isFullSize)
 {
     this.jointManager = jointManager;
     this.thumb        = thumb;
     this.indexFinger  = indexFinger;
     this.cam          = cam;
     this.isFullSize   = isFullSize;
     ConfigureRenderSettings();
 }
Пример #3
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before
    /// any of the Update methods is called the first time.
    /// </summary>
    void Start()
    {
        toggle = transform.GetComponent <Toggle>();
        thumb  = ScriptFind.FindTouchDetection(Finger.thumb);
        switch (flagType)
        {
        case FlagType.isTouched:
            thumb.OnTouchStatusChange += ChangeToggleState;
            break;

        case FlagType.isOverlapped:
            thumb.OnOverlapStatusChange += ChangeToggleState;
            break;

        default:
            break;
        }
    }