예제 #1
0
    public UiTile GetMouseOverTile()
    {
        UiTile     retTile;
        RaycastHit hitTile;

        retTile     = new UiTile();
        retTile.row = -1;
        retTile.col = -1;

        if (Physics.Raycast(UnityEngine.Camera.main.ScreenPointToRay(Input.mousePosition), out hitTile))
        {
            for (int row = 0; row < lanes.Count; row++)
            {
                UiRow thisRow;

                thisRow = lanes[row].GetComponent <UiRow>();

                for (int col = 0; col < thisRow.rowTiles.Length; col++)
                {
                    if ((hitTile.transform.name == thisRow.rowTiles[col].transform.name) &&
                        (hitTile.transform.parent.name == thisRow.transform.name))
                    {
                        retTile.row = row;
                        retTile.col = col;
                    }
                }
            }
        }

        return(retTile);
    }
예제 #2
0
 public void UnhighlightTile() => UiTile.GetComponent <MeshRenderer>().enabled = false;
예제 #3
0
 public void blinkTile(UiTile tile)
 {
     blinkTime     = 0;
     BlinkTile.col = tile.col;
     BlinkTile.row = tile.row;
 }
예제 #4
0
 public void HighlightTile(Color color = default)
 {
     UiTile.GetComponent <MeshRenderer>().material.color = color;
     UiTile.GetComponent <MeshRenderer>().enabled        = true;
 }
예제 #5
0
 // Use this for initialization
 void Start()
 {
     BlinkTile     = new UiTile();
     BlinkTile.row = -1;
     BlinkTile.col = -1;
 }