Ejemplo n.º 1
0
    public void Visualize(Vector2 position, Color color, float delay)
    {
        icon.color = color;
        rectTransform.localPosition = position;
        JobAction jobAction = (float timeStamp, bool isComplete) =>
        {
            isVisualize = true;
        };

        JobSystem.ScheduleUntil(jobAction, delay);
    }
Ejemplo n.º 2
0
    private void OnVisualize()
    {
        if (!GridBoard.current.IsPathSet())
        {
            return;
        }
        pathDrawer.Reset();
        List <Coord> path            = GetPath(GridBoard.current.GetPointACoord(), GridBoard.current.GetPointBCoord(), mapGrid, true);
        JobAction    scheduledAction = (float timeStamp, bool isCompleted) =>
        {
            pathDrawer.DrawPath(path);
        };

        JobSystem.ScheduleUntil(scheduledAction, AppSystem.path_delay);
    }
Ejemplo n.º 3
0
    public void DrawPath(List <Coord> path)
    {
        ResetDotTiles();
        float delay         = 0f;
        float intervalDelay = 0.001f;
        int   index         = 0;

        for (int i = 0; i < path.Count - 1; i++)
        {
            JobAction scheduledAction = (float timeStampe, bool isComplete) =>
            {
                GameObject dotTile = dotTilePool.GetInstance();
                dotTile.GetComponent <RectTransform>().localPosition = Utility.GetPositionInPixel(path[index].col, path[index].row);
                dotTile.SetActive(true);
                activeDotTiles.Add(dotTile);
                index++;
            };

            JobSystem.ScheduleUntil(scheduledAction, delay);
            delay += intervalDelay;
        }
    }