コード例 #1
0
ファイル: BagModel.cs プロジェクト: songqinhan/Unity-Bag
 public BaseItem(EquipListItem it)
 {
     this.id              = it.id;
     this.name            = it.name;
     this.type            = it.type;
     this.count           = it.count;
     this.gain            = it.gain;
     this.discribe        = it.discribe;
     this.imageName       = it.imageName;
     this.ScenePrefabPath = it.ScenePrefabPath;
 }
コード例 #2
0
ファイル: BagModel.cs プロジェクト: songqinhan/Unity-Bag
 public BagItemInfo(EquipListItem it, BagController ctl)
 {
     GameObject.Destroy(it.obj);
     Obj     = ResManager.Instance.LoadPrefabFromRes("Prefab/Bagitem", true);
     Image   = it.sprite;
     ItemCtl = Obj.GetComponent <BagItemController>();
     ItemCtl.SetController(ctl);
     this.id       = it.id;
     this.name     = it.name;
     this.type     = it.type;
     this.count    = it.count;
     this.gain     = it.gain;
     this.discribe = it.discribe;
 }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        EventManager.Register(this,
                              EventID.EVENT_UI_PACKAGE_SELECT_ITEM,
                              EventID.EVENT_UI_REFRESH_PACKAGEUI);

        packageEquipInfo = transform.Find("EquipInfo").GetComponent <PackageEquipInfo>();

        for (int i = 0; i < UserDataManager.instance.GetPackageCount(); i++)
        {
            GameObject    obj  = NGUITools.AddChild(grid.gameObject, equipListItem);
            EquipListItem item = obj.GetComponent <EquipListItem>();
            itemList.Add(item);
        }

        grid.repositionNow = true;
        grid.Reposition();
        scrollview.ResetPosition();

        RoleData rd = UserDataManager.instance.GetChooseRoleData();

        for (int i = 0; i < 9; i++)
        {
            GameObject    obj  = NGUITools.AddChild(equipedList, equipListItem);
            EquipListItem item = obj.GetComponent <EquipListItem>();
            itemEquipedList.Add(item);
            item.Init(null, null);

            //if(i >= rd.equipCount){
            //    item.iconSprite.color = new Color(100, 100, 100);
            //}

            obj.transform.localPosition = new Vector3(
                i % 3 * 160 - 160,
                -i / 3 * 160,
                0);
        }

        ReSetData();
    }
コード例 #4
0
ファイル: EquipListUI.cs プロジェクト: 517752548/-
 public void SelectedItem(EquipListItem currentSelectedItem, IPlayerHasEquips selectedItem)
 {
     this.currentSelectedItem = currentSelectedItem;
     //AttributeShowScript.SetupInfo(selectedItem.Attributes);
 }