コード例 #1
0
ファイル: BoardSpace.cs プロジェクト: rcornwal/DotsGame
    // Connect this board space with another, creating a line between them
    public void Connect(BoardSpace space)
    {
        Vector3        lineStart = GetScreenPosition();
        Vector3        lineEnd   = space.GetScreenPosition();
        ConnectionLine line      = connectionLines.GetUnusedLine();

        line.SetPoints(lineStart, lineEnd);
        connectedSpaces.Add(space);
    }
コード例 #2
0
ファイル: DotConnections.cs プロジェクト: rcornwal/DotsGame
    // Line from the last connected space to the touch position
    void UpdateLine(Vector3 touchPos)
    {
        if (!currentDotLink.IsEmpty())
        {
            BoardSpace lastConnected = currentDotLink.lastConnected;
            Vector3    lineStart     = lastConnected.GetScreenPosition();

            touchLine.SetType(lastConnected.GetCurrentDot().GetDotType());
            touchLine.SetPoints(lineStart, touchPos);
        }
    }