Exemplo n.º 1
0
    void SelectColumn()
    {
        RaycastHit hitInfo = new RaycastHit();

        //Debug.Log(hitInfo);
        //Debug.Log(hitInfo.ToString());
        if (!CheckSelection(out hitInfo))
        {
            return;
        }
        DisablableLogs("Hit " + hitInfo.transform.gameObject.name);

        // Get parent of the parent, while checking if it exists
        ColumnBehaviour column = GetColumn(hitInfo);

        DisablableLogs(column);
        if (!column)
        {
            return;
        }

        // Select column
        DisablableLogs("Column found!");
        if (column.fixedPosition)
        {
            DisablableLogs("Cannot move column");
            return;
        }
        if (selectedColumn)
        {
            selectedColumn.Deselect();
        }
        selectedColumn = column;
        selectedColumn.Select();
    }