Skip to content

Player UI#16

Open
andreafra wants to merge 1 commit into
supercoolorg:masterfrom
andreafra:player-ui
Open

Player UI#16
andreafra wants to merge 1 commit into
supercoolorg:masterfrom
andreafra:player-ui

Conversation

@andreafra
Copy link
Copy Markdown
Member

  • PlayerUI.cs - controls ui
  • Added UI elements in the hierarchy of playground.cs
  • Added two sprites for testing purposes

Copy link
Copy Markdown
Collaborator

@aleasto aleasto left a comment

Choose a reason for hiding this comment

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

Shouldn't we use always show the full block selection grid and move a selector instead of shifting the blocks?

// move each block to the left
foreach (var block in blockImages){
Vector3 startPos = block.transform.position;
block.transform.position = startPos + new Vector3(-45, 0, 0);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

block.transform.position += Vector3.Left * 45
Same for ScrollRight


blockImages.Add(newImage);
}
Destroy(blockImage);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't understand the logic here, why isn't it a prefab instead?

public void Init() {
for (int i = 0; i < blocks; i++) {
GameObject newImage = Instantiate(blockImage, panel.transform);
newImage.transform.position += new Vector3(45 * i, 0, 0);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Vector3.Left * 45 * i ?

Vector3 startPos = block.transform.position;
block.transform.position = startPos + new Vector3(45, 0, 0);
}
selectedElem -= 1;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

selectedElem-- ?

iconSpecial: {fileID: 1993209850}
panel: {fileID: 1587183896}
blockImage: {fileID: 1018820529}
blocks: 7
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In your sprite there's really only space for 4

@andreafra andreafra added the Don't Approve Yet There's some better PR opened for this issue label Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Don't Approve Yet There's some better PR opened for this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants