// Update is called once per frame void Update() { if (direction.x != 0 || direction.y != 0) { lastMoveDir = direction; } if (!IsAttacking) { MyAttackTime += Time.deltaTime; Animationmanager.IdleAnimation(lastMoveDir); Animationmanager.WalkAnimation(direction); } currentState.Update(); }
void Start() { this.animationObjectsList.Add(this.chair); this.addComponentToObjects(); this.cameraList.Add(this.CAM1_virtualcam); this.cameraList.Add(this.CAM2_virtualcam); this.chairController = this.chair.GetComponent <Animationcontroller>(); this.animationManager = Animationmanager.Instance; this.CAM1_cvirtualcamera = this.CAM1_virtualcam.GetComponent <CinemachineVirtualCamera>(); this.CAM1_dolly = this.CAM1_cvirtualcamera.GetCinemachineComponent <CinemachineTrackedDolly>(); this.CAM2_cvirtualcamera = this.CAM2_virtualcam.GetComponent <CinemachineVirtualCamera>(); this.CAM2_dolly = this.CAM2_cvirtualcamera.GetCinemachineComponent <CinemachineTrackedDolly>(); }