Exemple #1
0
                } // end DoBeforeEntering

                private void OnSelectedGrid(int id) {
                    string itemID = blueprintPack.GetItemIDForGrid(id);
                    IBluePrintInfo info = Configs.itemConfig.GetItemInfo(itemID) as IBluePrintInfo;
                    if (null == info) return;
                    // end if
                    printInfo = info;
                    buleprint.SetUIItem(ResourcesTool.LoadSprite(info.spritepath), 0);
                    int number = info.stuffNumber;
                    int x = (number - 1) * 40;
                    for (int i = 0; i < stuffArray.Length; i++) {
                        if (i < number) {
                            string stuffID = "";
                            if (false == info.TryGetStuffID(i, out stuffID)) continue;
                            // end if
                            IItemInfo stuff = Configs.itemConfig.GetItemInfo(stuffID);
                            if (null == stuff) continue;
                            // end if
                            int stuffCount = 0;
                            if (false == info.TryGetStuffCount(i, out stuffCount)) continue;
                            // end if
                            stuffArray[i].transform.localPosition = new Vector3((x - 80 * i), 0, 0);
                            stuffArray[i].gameObject.SetActive(true);
                            int numerator = SceneManager.mainCharacter.pack.GetItemPack(ConstConfig.STUFF).GetCountForID(stuff.id);
                            stuffArray[i].SetUIItem(ResourcesTool.LoadSprite(stuff.spritepath), 0);
                            stuffArray[i].item.SetPercent(numerator, stuffCount);
                            continue;
                        } // end if
                        stuffArray[i].gameObject.SetActive(false);
                    } // end for
                } // end OnSelectedGrid