void Awake() {
      _interactionBehaviour = GetComponent<InteractionBehaviourBase>();

      if (_interactionBehaviour != null) {
        _interactionBehaviour.OnGraspBeginEvent += onGraspBegin.Invoke;
        _interactionBehaviour.OnGraspEndEvent += onGraspEnd.Invoke;
      }
    }
        void Awake()
        {
            _interactionBehaviour = GetComponent <InteractionBehaviourBase>();

            if (_interactionBehaviour != null)
            {
                _interactionBehaviour.OnGraspBeginEvent += onGraspBegin.Invoke;
                _interactionBehaviour.OnGraspEndEvent   += onGraspEnd.Invoke;
            }
        }
Esempio n. 3
0
        void Awake()
        {
            _interactionBehaviour = GetComponent <InteractionBehaviourBase>();

            if (_interactionBehaviour != null)
            {
                _interactionBehaviour.OnHandGraspedEvent  += onHandGrasp.Invoke;
                _interactionBehaviour.OnHandReleasedEvent += onHandRelease.Invoke;
            }
        }
    protected override void OnEnable() {
      base.OnEnable();

      if (targets.Length == 1) {
        _interactionBehaviour = target as InteractionBehaviourBase;
        _manager = _interactionBehaviour.GetComponentInParent<InteractionManager>();
        if (_manager == null) {
          _manager = FindObjectOfType<InteractionManager>();
        }
      } else {
        _interactionBehaviour = null;
      }

      if (PrefabUtility.GetPrefabType((target as Component).gameObject) != PrefabType.Prefab) {
        specifyCustomDecorator("_manager", managerDectorator);
      }
    }
        protected override void OnEnable()
        {
            base.OnEnable();

            if (targets.Length == 1)
            {
                _interactionBehaviour = target as InteractionBehaviourBase;
                _manager = _interactionBehaviour.GetComponentInParent <InteractionManager>();
                if (_manager == null)
                {
                    _manager = FindObjectOfType <InteractionManager>();
                }
            }
            else
            {
                _interactionBehaviour = null;
            }

            if (PrefabUtility.GetPrefabType((target as Component).gameObject) != PrefabType.Prefab)
            {
                specifyCustomDecorator("_manager", managerDectorator);
            }
        }