public void Start() { items = new ActionItem[maxItems]; actionBarGUIContainer = GameObjectFactory.NewGameObject("Action Bar GUI Container", gameObject.transform); ActionBarGUI.CreateComponent(actionBarGUIContainer, this, items, offset, tilesize); ActionBarController.CreateComponent(gameObject, this); }
public static ActionBarGUI CreateComponent(GameObject parent, ActionBar actionBar, ActionItem[] items, Vector2 offset, int tilesize) { ActionBarGUI actionBarGUI = parent.AddComponent <ActionBarGUI>(); actionBarGUI.actionBar = actionBar; actionBarGUI.items = items; actionBarGUI.offset = offset; actionBarGUI.tilesize = tilesize; return(actionBarGUI); }