//todo: refactor this using a interaction interface public void Initialize(IInteractionListener listener, CalibratedObject calibratedObject, GameObject virtualVictoria) { _listener = listener; _calibratedObject = calibratedObject; _virtualVictoria = virtualVictoria; AddTrigger(_translateXPos, () => _calibratedObject.Translate(_translationSensitivity * Vector3.right)); AddTrigger(_translateXNeg, () => _calibratedObject.Translate(_translationSensitivity * Vector3.left)); AddTrigger(_translateYPos, () => _calibratedObject.Translate(_translationSensitivity * Vector3.up)); AddTrigger(_translateYNeg, () => _calibratedObject.Translate(_translationSensitivity * Vector3.down)); AddTrigger(_translateZPos, () => _calibratedObject.Translate(_translationSensitivity * Vector3.forward)); AddTrigger(_translateZNeg, () => _calibratedObject.Translate(_translationSensitivity * Vector3.back)); AddTrigger(_rotYPos, () => _calibratedObject.RotateY(_rotationSensitivity * 1f)); AddTrigger(_rotYNeg, () => _calibratedObject.RotateY(_rotationSensitivity * -1f)); AddTrigger(_scalePos, () => _calibratedObject.ScaleUniform(_scaleSensitivity * 1f)); AddTrigger(_scaleNeg, () => _calibratedObject.ScaleUniform(_scaleSensitivity * -1f)); AddTrigger(_reset, () => _calibratedObject.ResetCalibration()); AddTrigger(_showHitMesh, () => _virtualVictoria.gameObject.SetActive(true)); AddTrigger(_hideHitMesh, () => _virtualVictoria.gameObject.SetActive(false)); AddTrigger(_startAlpha, () => _listener.StartTourCommand(TourController.TourMode.Guided)); AddTrigger(_startBravo, () => _listener.StartTourCommand(TourController.TourMode.Unguided)); AddTrigger(_startCharlie, () => _listener.StartTourCommand(TourController.TourMode.Mixed)); }
//animator IDs //private uint AnimIDCounter; private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } GameStateAnim = GetComponent <Animator>(); calibratedObject = new CalibratedObject(); SetUniqueAnimStateIDs(); }