예제 #1
0
    public void Initialize(int fingerId, FingerData data, HandController handController, FingerRaycaster fingerRaycaster)
    {
        if (_isInitialized)
        {
            return;
        }

        FingerId = fingerId;

        FingerData = data;

        HandController = handController;
        _raycaster     = fingerRaycaster;

        Set();

        _isInitialized = true;
    }
예제 #2
0
    private void Start()
    {
        poseState = PoseState.Rest;

        if (!HandController)
        {
            HandController = GetComponentInParent <HandController>();
        }

        if (!_raycaster)
        {
            _raycaster = GetComponent <FingerRaycaster>();
        }

        InitialRotations        = new Quaternion[_bones.Length];
        _phalanxOnFinalRotation = new bool[_bones.Length];

        for (int i = 0; i < _bones.Length; i++)
        {
            InitialRotations[i] = _bones[i].localRotation;
            Debug.Log(_bones[i].localRotation + " " + InitialRotations[i]);
        }
    }