Пример #1
0
    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);
        }
    }
Пример #2
0
    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);
            }
        }
    }
Пример #3
0
 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);
 }