private void Awake()
    {
        if (s_instance == null)
        {
            s_instance = this;
        }

        _manager = GetComponent <InteractionManager>();
    }
Exemplo n.º 2
0
    private void OnEnable()
    {
        _interaction.OnPerControllerGraspBegin -= OnPerControllerGraspBegin;
        _interaction.OnPerControllerGraspBegin += OnPerControllerGraspBegin;
        _interaction.OnPerControllerGraspEnd   -= OnPerControllerGraspEnd;
        _interaction.OnPerControllerGraspEnd   += OnPerControllerGraspEnd;
        _interaction.OnGraspStay -= OnGraspStay;
        _interaction.OnGraspStay += OnGraspStay;

        if (_pinchManager == null)
        {
            _pinchManager = PinchInteractionManager.instance;

            if (_pinchManager == null)
            {
                Debug.LogError("Pinch Interaction Behaviours require an Pinch Interaction Manager. Please "
                               + "ensure you have an Pinch InteractionManager in your scene.");
                this.enabled = false;
            }
        }
    }