Exemplo n.º 1
0
    public void OnUnitMoved(HexScript oldHex, HexScript newHex)
    {
        // This GameObject is supposed to be a child of the hex we are
        // standing in. This ensures that we are in the correct place
        // in the hierachy
        // Our correct position when we aren't moving, is to be at
        // 0,0 local position relative to our parent.

        // TODO: Get rid of VerticalOffset and instead use a raycast to determine correct height
        // on each frame.
        move        = true;
        oldPosition = oldHex.PositionFromCamera();
        newPosition = newHex.PositionFromCamera();
    }
Exemplo n.º 2
0
 public Vector3 GetHexPosition(HexScript Hex)
 {
     return(Hex.PositionFromCamera(Camera.main.transform.position, numRows, numColumns));
 }