public void Initialize(Frame frame) { foreach (Box box in frame.Boxes) { GameObject boxObj = Instantiate(boxWrapperPrefab, transform); BoxWrapper boxWrapper = boxTypeComponentMap[box.GetType().Name](boxObj); boxWrapper.Initialize(box); } }
public void SetAlpha(float alpha) { SetSpriteRendererAlpha(GetComponent <SpriteRenderer>(), alpha); for (int i = 0; i < transform.childCount; i++) { BoxWrapper bw = transform.GetChild(i).GetComponent <BoxWrapper>(); if (bw != null) { SetSpriteRendererAlpha(bw.GetComponent <SpriteRenderer>(), alpha); } } }
void OnGUI() { if (!enabled) { return; } if (bw == null) { bw = new BoxWrapper(); } if (tb == null) { tb = new Toolbar(); } if (buttons == null) { InitButtons(); } bw.OnGUI(buttons.Count); tb.OnGUI(TrimRekt(bw.GetRekt()), buttons); }