Skip to content

Conversation

Copy link

Copilot AI commented Oct 30, 2025

Replaced single-letter and abbreviated variable names with descriptive identifiers across the Activities system to improve code readability and maintainability.

Changes

ActivityTimer.cs

  • msmilliseconds, tfTimetimeTextField, coTimertimerCoroutine

DraggableTile.cs

  • manageractivityManager, activityTranformactivityTransform (typo fix)
  • Lambda parameters: ci/dtcardInfo/draggableTile

ActivityOrder.cs

  • Type casting: csdorderSettings
  • UI components: imgghostImage, ccolor
  • Coordinates: t/p/poselapsedTime/progress/position
  • Transforms: rtrectTransform, gotileGameObject

ActivityMatch.cs (most extensive)

  • Dimensions: w/h/nwidth/height/count
  • Components: rt/qi/airectTransform/questionItem/answerItem
  • Collections: pa/dspoolArea/dropSlot
  • Coordinates: t/x/y/posinterpolationFactor/xPosition/yPosition/position

Example

Before:

var rt = BoardArea as RectTransform;
float w = rt.rect.width;
float h = rt.rect.height;
int n = questionItems.Count;
for (int i = 0; i < n; i++) {
    var qi = questionItems[i];
    var t = (n == 1) ? 0.5f : (float)i / (n - 1);
    float x = Mathf.Lerp(-w * 0.5f, w * 0.5f, t);
}

After:

var rootRectTransform = BoardArea as RectTransform;
float width = rootRectTransform.rect.width;
float height = rootRectTransform.rect.height;
int count = questionItems.Count;
for (int i = 0; i < count; i++) {
    var questionItem = questionItems[i];
    var interpolationFactor = (count == 1) ? 0.5f : (float)i / (count - 1);
    float xPosition = Mathf.Lerp(-width * 0.5f, width * 0.5f, interpolationFactor);
}

201 lines refactored across 4 files. Loop counters (i, j) preserved per .NET conventions.

Original prompt

Suggest more descriptive variable and function names


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Suggest more descriptive variable and function names Refactor cryptic variable names to descriptive identifiers Oct 30, 2025
Copilot AI requested a review from StefanoCecere October 30, 2025 16:25
Copilot finished work on behalf of StefanoCecere October 30, 2025 16:25
[DeEmptyAlert]
[SerializeField] Image bar;
[DeEmptyAlert]
[SerializeField] TMP_Text tfTime;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tfTime is textfieldTime, no timeTextField .. tf is the acronym of textfield

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants