示例#1
0
    // Use this for initialization
    void Start()
    {
        Color c = GetComponent <Image>().color;

        GetComponent <Image>().color = new Color(c.r, c.g, c.b, 0);

        foreach (Transform t in transform)
        {
            children.Add(t.gameObject);
        }

        foreach (RectTransform t in children[0].transform)
        {
            GlobalItems.NewSize(t);
        }
    }
示例#2
0
    void Start()
    {
        aim   = GameObject.Find("AimImage").GetComponent <Image>();
        close = GameObject.Find("CloseImage").GetComponent <Image>();

        foreach (Transform t in transform)
        {
            children.Add(t.gameObject);
        }

        for (int i = 0; i < children.Count; i++)
        {
            if (children[i].GetComponent <Text>())
            {
                text.Add(new MessageIntro(children[i].GetComponent <Text>()));
                text[text.Count - 1].textColor = new Color(text[text.Count - 1].textColor.r, text[text.Count - 1].textColor.g, text[text.Count - 1].textColor.b, 0f);

                timers.Add(0);
            }
            if (children[i].layer == LayerMask.NameToLayer("UILeftTag"))
            {
                left = new TagInfoHandler(children[i]);
            }
            if (children[i].layer == LayerMask.NameToLayer("UIRightTag"))
            {
                right = new TagInfoHandler(children[i]);
            }
        }

        aim.color   = new Color(aim.color.r, aim.color.g, aim.color.b, 0);
        close.color = new Color(close.color.r, close.color.g, close.color.b, 0);

        foreach (GameObject g in children)
        {
            if (g.GetComponent <RectTransform>())
            {
                GlobalItems.NewSize(g.GetComponent <RectTransform>());
            }
        }
    }