Skip to content

Feature/gui lib#1

Closed
FriedrichWessel wants to merge 25 commits intomasterfrom
feature/gui_lib
Closed

Feature/gui lib#1
FriedrichWessel wants to merge 25 commits intomasterfrom
feature/gui_lib

Conversation

@FriedrichWessel
Copy link
Copy Markdown
Member

Features Implemented:

  • General Structure
  • Position Elements
  • General InputEventHandling
  • Click, Up, Down, Move and HoverEvent implemented
  • DebugFeatures
  • Generel Structure for Interaction Behaviour

Known Issues: (-> BugListe im Trelle)

  • Postion dont work with all Resoultions
  • InteractionBehaviour dont work on Screen Element

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Waere es nicht angebrachter, foreach(Transform child in transform) zu benutzen (siehe C# Beispiel hier)? GetComponentsInChildren() rennt laut Doku durch alle Kinder und Kindeskinder. Und diese Funktion wird ja bei jedem Kind auch nochmal aufgerufen.
Die if-Abfrage koennte man dann durch ein simples if(child is Box) {...} ersetzen.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ich wusste nich das es das iis Box gibt, wenn das funzt dann is das besser

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Korrektur:
Wenn ich mich nicht irre, ist child dann natuerlich 'ne Transform, weshalb das is wiederum nicht funktionieren wird.
Aber man sollte folgendes schreiben koennen:

List<Box> boxes = new List<Box>();
foreach(Transform child in transform) {
  boxes.AddRange(child.gameObjetct.GetComponents<Box>());
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Machts dass dann wirklich besser als meine Variante ? Ich glaube eher nich...

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