コード例 #1
0
    public void setApp(App app)
    {
        this.app = app;
        GameObject    icon   = transform.GetChild(0).gameObject;
        RectTransform iconRt = icon.GetComponent <RectTransform> ();

        iconRt.sizeDelta = new Vector2(launcherModel.iconWidth, launcherModel.iconWidth);
        GameObject lable = icon.transform.GetChild(0).gameObject;

        if (!app.isPlaceholder)
        {
            icon.SetActive(true);
            //				Debug.Log ("!app.isPlaceholder");
            if (app.iconUrl != null && app.iconUrl.Length > 0)
            {
                //					Log (TAG, "app.iconUrl:"+app.iconUrl);
                Sprite sprite = mLauncherController.LoadImgByIO(app);
                Image  img    = icon.GetComponent <Image> ();
                img.sprite = sprite;
            }
            Text textLable = lable.GetComponent <Text> ();
            textLable.fontSize = launcherModel.fontSize;
            textLable.text     = app.appName;
        }
        else
        {
            //				Debug.Log ("app.isPlaceholder");
            icon.SetActive(false);
        }
    }
コード例 #2
0
    public void show(App app)
    {
        btnPanel.SetActive(true);
        hintText.text = hintStr;
        RectTransform dialogRT = GetComponent <RectTransform> ();

        dialogRT.DOScale(1f, LauncherController.ANIM_DURATION);
        GameObject icon   = GameUtils.GetChildByName(gameObject, "icon");
        Image      img    = icon.GetComponent <Image> ();
        Sprite     sprite = mLauncherController.LoadImgByIO(app);

        img.sprite = sprite;
    }