matrixjc122 / worldX735

1 stars 0 forks source link

Canvas UI #3

Open matrixjc122 opened 9 years ago

matrixjc122 commented 9 years ago

Write UIOnClickBehaviour.cs Implements OnClick() which is connected to its button representation at the Start(). Theroretically for each button a single script could be developed. In this case each Button needs a unique "canvas"-name so it can be identified using the "gameObject.name" attribute.

matrixjc122 commented 9 years ago

Pushed new branch 3-CanvasUI

matrixjc122 commented 9 years ago

In the future, the UIMain class provides a good place to generate the buttons on the fly. Use the worldXSignelton.ZombiKnownTypes and some button generative like this:

public void CreateButton(Transform panel ,Vector3 position, Vector2 size, UnityEngine.Events.UnityAction method) { GameObject button = new GameObject(); button.transform.parent = panel; button.AddComponent(); button.AddComponent