public void MoveToElevator() { if (_isAngry) { _isAngry = false; _warningCanvas.SetActive(false); _animator.EndAngry(); _transformRoot.DORotate(new Vector3(0, 90, 0), 1.19f, RotateMode.Fast).OnComplete(() => { _animator.Walk(); if (!_reachedWaitPos) { return; } _moveToElevator = true; }); } else { _animator.Walk(); if (!_reachedWaitPos) { return; } _moveToElevator = true; } }
private void CheckElevator() { //_animator.Idle(); _reachedWaitPos = true; if (_elevator.IsStopedOnTheFloor(_currentFloor.Index)) { _animator.Walk(); } }
public override void Spawn(FloorData currentFloor, FloorData desiredFloor, ElevatorController elevator, Material material, GameManager gm) { gm.OnElevatorStoped += ElevatorStoped; gm.OnFloorChanged += ElevatorMoved; gm.OnFailedToGetPosition += HandleCrowdedFloor; _gameManager = gm; _elevator = elevator; _currentFloor = currentFloor; DesiredFloor = desiredFloor; MeshRenderer.material = material; _meshRendererRagDoll.material = material; _animator = GetComponent <UserAnimator>(); _rigidbody = GetComponent <Rigidbody>(); _uiColorChanger = FindObjectOfType <UICcolorsChanger>(); _myWaitPosition = currentFloor.WaitPos; _animator.Walk(); MoveToWaitPos(_myWaitPosition); }