示例#1
0
        public void Start(Path path, Mover mover, Controller controller = null)
        {
            _path                 = path;
            _controller           = controller;
            _mover                = mover;
            _mover.OnTileChanged += OnTileChanged;
            _startingPosition     = _mover.CurrentGridPosition;
            _targetPosition       = _startingPosition;
            _nextIndex            = 1;
            _repeatCount          = _path.RepeatCount;
            _direction            = _path.Nodes.Length > 1 ? 1 : 0;
            _delay                = Running ? _path.Nodes[0].Delay : 0.0f;

            FindPathToNextNode();

            _coroutine = _mover.StartCoroutine(Run());
        }