public void SetPath(IEnumerable <Transform> path)
        {
            if (Actor.TimeActions.CommitTimeAction((path.Count() - 1) * MovementCost))
            {
                this.path      = path.ToList();
                targetIndex    = 0;
                targetLocation = path.First();
                isMoving       = true;

                destinationLine.Show(path);
                destinationMarker.Show(path);
            }
        }
Example #2
0
        void Update()
        {
            CheckCellUnderMouse();

            if (SelectedActorReady && calculatedPath != null)
            {
                MovementLine.Show(calculatedPath);
                MovementMarker.Show(calculatedPath);
            }

            if (Input.GetMouseButtonDown(0))
            {
                CommandMove();
                CommandSelect();
            }

            if (Input.GetMouseButtonDown(1))
            {
                Deselect();
            }


            if (Input.GetKeyDown(KeyCode.Space) && selectedActor != null)
            {
                SwitchMode();
            }
        }