Beispiel #1
0
 public GameObject AddItemTitle(ItemDataBlock item, float aboveSpace)
 {
     float contentHeight = this.GetContentHeight();
     GameObject gameObject = NGUITools.AddChild(this.addParent, this.itemTitlePrefab);
     gameObject.GetComponentInChildren<UILabel>().text = item.name;
     UITexture componentInChildren = gameObject.GetComponentInChildren<UITexture>();
     componentInChildren.material = componentInChildren.material.Clone();
     componentInChildren.material.Set("_MainTex", item.GetIconTexture());
     gameObject.transform.SetLocalPositionY(-(contentHeight + aboveSpace));
     return gameObject;
 }
Beispiel #2
0
    public GameObject AddItemTitle(ItemDataBlock item, float aboveSpace)
    {
        float      contentHeight = this.GetContentHeight();
        GameObject obj2          = NGUITools.AddChild(this.addParent, this.itemTitlePrefab);

        obj2.GetComponentInChildren <UILabel>().text = item.name;
        UITexture componentInChildren = obj2.GetComponentInChildren <UITexture>();

        componentInChildren.material = componentInChildren.material.Clone();
        componentInChildren.material.Set("_MainTex", item.GetIconTexture());
        obj2.transform.SetLocalPositionY(-(contentHeight + aboveSpace));
        return(obj2);
    }
Beispiel #3
0
    public GameObject AddItemTitle(ItemDataBlock itemdb, IInventoryItem itemInstance = null, float aboveSpace = 0)
    {
        float      contentHeight = this.GetContentHeight();
        GameObject obj2          = NGUITools.AddChild(this.addParent, this.itemTitlePrefab);

        obj2.GetComponentInChildren <UILabel>().text = (itemInstance == null) ? itemdb.name : itemInstance.toolTip;
        UITexture componentInChildren = obj2.GetComponentInChildren <UITexture>();

        componentInChildren.material = componentInChildren.material.Clone();
        componentInChildren.material.Set("_MainTex", itemdb.GetIconTexture());
        componentInChildren.color = ((itemInstance == null) || !itemInstance.IsBroken()) ? Color.white : Color.red;
        obj2.transform.SetLocalPositionY(-(contentHeight + aboveSpace));
        return(obj2);
    }
Beispiel #4
0
 public GameObject AddItemTitle(ItemDataBlock itemdb, IInventoryItem itemInstance = null, float aboveSpace = 0)
 {
     float contentHeight = this.GetContentHeight();
     GameObject gameObject = NGUITools.AddChild(this.addParent, this.itemTitlePrefab);
     gameObject.GetComponentInChildren<UILabel>().text = (itemInstance == null ? itemdb.name : itemInstance.toolTip);
     UITexture componentInChildren = gameObject.GetComponentInChildren<UITexture>();
     componentInChildren.material = componentInChildren.material.Clone();
     componentInChildren.material.Set("_MainTex", itemdb.GetIconTexture());
     componentInChildren.color = (itemInstance == null || !itemInstance.IsBroken() ? Color.white : Color.red);
     gameObject.transform.SetLocalPositionY(-(contentHeight + aboveSpace));
     return gameObject;
 }