public static void SimulateAction(DummyEnemy _enemy, Vector3 _target, int index) { Vector3 _toVector = _target - _enemy.transform.position; _enemy.transform.position = _target; _enemy.SetAction(new VectorIntAction(ActionType.AIMoveTo, _toVector, index, _enemy.Time)); _enemy.AddToTIme(_toVector.magnitude / _enemy.MoveSpeed); _enemy.SetAction(new VectorIntAction(ActionType.AIMoveToUnset, _toVector, index, _enemy.Time)); }
public static void SimulateAction(DummyEnemy _enemy, Vector3 _target, int index) { float _distance = Vector3.Distance(_enemy.transform.position, _target); _enemy.transform.position += _enemy.transform.forward * _distance; _enemy.SetAction(new ValueIntAction(ActionType.AIMoveForward, _distance, index, _enemy.Time)); _enemy.AddToTIme(_distance / _enemy.MoveSpeed); _enemy.SetAction(new ValueIntAction(ActionType.AIMoveForwardUnset, _distance, index, _enemy.Time)); }
public static void SimulateAction(DummyEnemy _enemy, Vector3 _target, int index) { Vector3 _currentForward = _enemy.transform.forward; Vector3 _tempTarget = new Vector3(_target.x, _enemy.transform.position.y, _target.z); Vector3 _up = _enemy.transform.up; _enemy.transform.LookAt(_tempTarget); float _angle = Util.AngleBetweenVector3(_currentForward, _enemy.transform.forward, _up); _enemy.SetAction(new ValueIntAction(ActionType.AIRotate, _angle, index, _enemy.Time)); _enemy.AddToTIme(Math.Abs(_angle) / _enemy.RotationSpeed); _enemy.SetAction(new ValueIntAction(ActionType.AIRotateUnset, _angle, index, _enemy.Time)); }
public static void SimulateAction(DummyEnemy _enemy, float _waitAmount, int index) { _enemy.SetAction(new ValueIntAction(ActionType.AIWait, _waitAmount, index, _enemy.Time)); _enemy.AddToTIme(_waitAmount); _enemy.SetAction(new ValueIntAction(ActionType.AIWaitUnset, _waitAmount, index, _enemy.Time)); }