public void HoldFire() { AimLine.SetActive(false); holsterPivot.rotation = crossHair.rotation; Pistol.transform.SetParent(holsterPivot.transform.GetChild(0)); Pistol.transform.localScale = Vector3.one; Pistol.transform.localPosition = Vector3.zero; Pistol.transform.DOLocalRotate(new Vector3(0, 0, 0), 0.15f, RotateMode.Fast).SetEase(Ease.Linear); holsterPivot.DOLocalRotate(new Vector3(0, -180, 0), 0.15f, RotateMode.Fast).SetEase(Ease.Linear).OnComplete(() => { MovePlayer(); }); }
public void TakeAim() { holsterPivot.DOLocalRotate(crossHair.localRotation.eulerAngles, 0.15f, RotateMode.Fast).SetEase(Ease.Linear).OnComplete(() => { Pistol.transform.SetParent(crossHair.transform.GetChild(0)); Pistol.transform.localScale = Vector3.one; Pistol.transform.localPosition = Vector3.zero; Pistol.transform.DOLocalRotate(new Vector3(0, 0, 0), 0.15f, RotateMode.Fast).SetEase(Ease.Linear).OnComplete(() => { AimLine.SetActive(true); isFired = false; }); }); }
public void PlayDead() { AimLine.SetActive(false); Pistol.SetActive(false); GameManager.gameState = "Result"; playerMesh.DOMove(deadPosition.position, 0.5f, false).OnComplete(() => { mainCam.DOMove(PathSpawner.instance.levelBlocks[0].GetComponent <LevelProperties>().Enemies[0].endCamPoint.position, 0.3f); mainCam.DORotate(PathSpawner.instance.levelBlocks[0].GetComponent <LevelProperties>().Enemies[0].endCamPoint.rotation.eulerAngles, 0.1f); }); playerMesh.DORotate(deadPosition.rotation.eulerAngles, 0.3f, RotateMode.Fast); GameManager.instance.DelayedReload(3); }