public override void DoInteraction() { _coffin.layer = LayerMaskManager.Get(Layer.Landmark); AnimationUtils.MoveSmoothlyTo(_coffin.transform, _tomb.transform.position - Vector3.up * 1.5f, 0.5f); AnimationUtils.LookTowardsHorizontal(_coffin.transform, _tomb.transform.right, 0.5f, () => { _coffin.transform.parent = _tomb.transform; _coffin.GetComponent <Collider>().enabled = true; }); // TODO LookTowardsVertical (using arg lookDir instead of LookAtPoint) _tombComponent.PlayerTombTransition(new PoemState(_tombComponent), false); _tombComponent.HideMarker(); _tombComponent.HideColliders(); AudioController.GetInstance().AddMusicChannel(); }
// positions are hardcoded as terrain carving is based on fixed coordinates and it is not going to change public override void DoInteraction() { HideFeedback(); Vector3[] v = _terrainCarver.DoCarveAction(new Ray(_player.transform.position, _player.MainCamera.transform.forward)); Vector3 upperLeft = v[0]; Vector3 lowerRight = v[1]; upperLeft = upperLeft + new Vector3(-1, 0, 0); lowerRight = lowerRight + new Vector3(0, 0, -1); GameObject tomb = new GameObject("_tomb"); TombComponent tombComponent = tomb.AddComponent <TombComponent>(); tombComponent.Init(upperLeft, lowerRight); tombComponent.PlayerTombTransition(new DigState(tombComponent), true); }