예제 #1
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            // Check the hexagon clicked.
            Debug.Log(HexGridManager.GetHexCoordinates(Camera.main.ScreenToWorldPoint(Input.mousePosition)));
        }

        // Draw the Vectrosity arrow.
        arrow.points3.Clear();
        arrow.points3.Add(pos2);
        arrow.points3.Add(pos1);
        arrow.Draw();

        arrow.textureOffset = Time.time * AnimationSpeed % 1;
    }
예제 #2
0
 void OnMouseUp()
 {
     // When mouse is released, the arrow must point to the center of the hex.
     pos2 = HexGridManager.GetTransformCoordinates(HexGridManager.GetHexCoordinates(Camera.main.ScreenToWorldPoint(Input.mousePosition)));
 }