protected override void Init()
    {
        ScroRect.movementType = UnityEngine.UI.ScrollRect.MovementType.Clamped;
        ItemSkin = transform.Find("item").gameObject;
        ItemSkin.AddComponent <UDragScroll>();
        ItemSkin.AddComponent <FullImageItemFunc>();
        rectTranEffectImage = this.transform.parent;
        setMainBtn          = UITool.GetUIComponent <Button>(rectTranEffectImage, "setMainbtn");
        delete          = UITool.GetUIComponent <Button>(rectTranEffectImage, "delete");
        effectShareMain = UITool.GetUIComponent <Button>(rectTranEffectImage, "share");
        RectTransform arrayPoint = UITool.GetUIComponent <RectTransform>(rectTranEffectImage, "ScrollPoint");


        SetData(2048, 1536, arragement);
        ScroRect.OnScrollDragedStart = OnScrollDragedStart;
        ScroRect.OnScrollDragedEnd   = OnScrollDragedEnd;
        setMainBtn.onClick.AddListener(OnEffectSetMain);
        delete.onClick.AddListener(OnEffectDelete);
        effectShareMain.onClick.AddListener(OnEffectShare);

        int i = 0;

        pointDic.Clear();
        Image[] Images = arrayPoint.GetComponentsInChildren <Image>(true);
        foreach (Image item in Images)
        {
            if (!pointDic.ContainsValue(item))
            {
                pointDic.Add(i, item);
            }
            i++;
        }
        currPoint = pointDic[0];
    }
 internal void CopyToSkeleton(Skeleton skeleton, GameObject parent, Item item)
 {
     foreach (SkeletonSkin skeletonSkin in this.SkeletonSkins)
     {
         GameObject gameObject1 = new GameObject();
         gameObject1.get_transform().set_parent(parent.get_transform());
         GameObject gameObject2 = gameObject1;
         Skeleton   skeleton1   = skeleton;
         skeletonSkin.DuplicateAndRetarget(gameObject2, skeleton1).set_updateWhenOffscreen(true);
         if (item != null && item.skin > 0UL)
         {
             ItemSkinDirectory.Skin skin = ((IEnumerable <ItemSkinDirectory.Skin>)item.info.skins).FirstOrDefault <ItemSkinDirectory.Skin>((Func <ItemSkinDirectory.Skin, bool>)(x => (long)x.id == (long)item.skin));
             if (skin.id == 0 && item.skin > 0UL)
             {
                 WorkshopSkin.Apply(gameObject1, item.skin, (Action)null);
                 break;
             }
             if ((long)skin.id != (long)item.skin)
             {
                 break;
             }
             ItemSkin invItem = skin.invItem as ItemSkin;
             if (Object.op_Equality((Object)invItem, (Object)null))
             {
                 break;
             }
             invItem.ApplySkin(gameObject1);
         }
     }
 }
Beispiel #3
0
 void Start()
 {
     spriteRenderer = GetComponent <SpriteRenderer>();
     itemSkin       = GetComponent <ItemSkin> ();
     itemSkin.SetBoardView(spriteRenderer, itemType);
     path = new List <GridItem>();
 }
 protected override void Init()
 {
     ItemSkin = transform.Find("item").gameObject;
     ItemSkin.AddComponent <UDragScroll>();
     ItemSkin.AddComponent <GroupItemFunc>();
     SetData(100, 100, _arrangement, 0, 0, 0, 20, 3);
 }
    protected override void Init()
    {
        ItemSkin           = transform.Find("item").gameObject;
        MaterialController = UITool.GetUIComponent <RectTransform>(transform, "Controller");
        MaterialController.gameObject.SetActive(true);
        MaterialController.SetParent(ContentRectTrans.parent);
        MaterialController.localScale = Vector3.one;
        materialDelete = UITool.GetUIComponent <Button>(MaterialController, "Delete");
        materialDelete.onClick.AddListener(RemoveMaterial);
        cancelDelete = UITool.GetUIComponent <Image>(MaterialController, "Delete/cancelDelete");
        UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>();

        uscr.scroRect = ScroRect;
        ItemSkin.AddComponent <MaterailImageItemFunc>();
        specialitem               = new MaterialItemData("", "", "");
        specialitemBottom         = new MaterialItemData("", "", "");
        specialitemBottom.special = true;
        specialitem.special       = true;
        SetData(100, 130, _arrangement, 100, 100, 10, 30, 1);
        //for (int i = 0; i < 1; i++)
        //{
        //    Msgs.Add(new ItemData());
        //}
        //RefreshDisplay(Msgs,false,true);
        //skinClone.SetActive(false);
        //Display(Msgs);
    }
Beispiel #6
0
    protected override void Init()
    {
        ItemSkin = transform.Find("itemPictures").gameObject;
        ItemSkin.AddComponent <SetMainOfferItemFunc>();
        UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>();

        uscr.scroRect = ScroRect;
        SetData(1980, 200, _arrangement, 6, 20);
        //Display(msgs);
    }
    protected override void Init()
    {
        ItemSkin = transform.Find("ImageItemSkin").gameObject;
        view     = ItemSkin.transform.FindChild("GameObject/view").gameObject;
        UDragScroll uscr = view.AddComponent <UDragScroll>();

        uscr.scroRect = ScroRect;
        ItemSkin.AddComponent <SchemeEffectImageItemFunc>();
        SetData(672, 504, _arrangement, 6, 20, 70, 30, 2);
    }
Beispiel #8
0
    protected override void Init()
    {
        base.Init();
        ItemSkin = transform.Find("item").gameObject;
        ItemSkin.AddComponent <LobbyRoomItemFunction>();
        UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>();

        uscr.scroRect = ScroRect;
        SetData(640, 80, arragement, 6, 20, 10, 5);
    }
Beispiel #9
0
    protected override void Init()
    {
        base.Init();
        ItemSkin = transform.Find("item").gameObject;
        ItemSkin.AddComponent <ProductItemFunction>();
        UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>();

        uscr.scroRect = ScroRect;
        SetData(440, 460, _arrangement, 100, 100, 50, 50, 2);
    }
Beispiel #10
0
 protected override void Init()
 {
     ItemSkin = transform.Find("detailItem").gameObject;
     ItemSkin.AddComponent <UDragScroll>();
     ItemSkin.AddComponent <GoodDetailItemFunc>();
     SetData(_cellWidth, _cellHeight, _arrangement, 0, 0, 0, 0, 1);
     for (int i = 0; i < 20; i++)
     {
         msgs.Add(new ItemData());
     }
     Display(msgs);
 }
    protected override void Init()
    {
        ItemSkin = transform.Find("itemPictures").gameObject;
        UDragScroll us = ItemSkin.AddComponent <UDragScroll>();

        schemePage.scheme.mask.SetAsLastSibling();
        us.scroRect = ScroRect;
        ItemSkin.AddComponent <GenerateOfferItemFunc>();
        SetData(1980, 200, _arrangement, 6, 20);
        AddDeleteEvent(DeleteAllSelectItem);
        AddToggleEvent(ToggleOffOrOn);
    }
 protected override void Init()
 {
     ItemSkin = transform.Find("itemPictures").gameObject;
     ItemSkin.AddComponent <UDragScroll>();
     ItemSkin.AddComponent <CreateOfferItemFunc>();
     SetData(_cellWidth, _cellHeight, _arrangement, _upperLimitIndex, _lowerLimitIndex, _cellWidthSpace, _cellHeightSpace, _maxPerLine);
     // 测试
     for (int i = 0; i < 20; i++)
     {
         msgs.Add(new ItemData());
     }
     Display(msgs);
 }
    protected override void Init()
    {
        ItemSkin = transform.Find("ManifestItemSkin").gameObject;
        view     = ItemSkin.transform.FindChild("view").gameObject;
        UDragScroll uscr = view.AddComponent <UDragScroll>();

        uscr.scroRect = ScroRect;
        ItemSkin.AddComponent <SchemeManifestItemFunc>();
        specialitem         = new ManifestOfferItem("", "", "", "", "", "", 0);
        specialitem.special = true;
        SetData(672, 504, _arrangement, 6, 20, 70, 30, 2);
        // 初始化以后就隐藏 点击清单 在出现
        UITool.SetActionFalse(this.gameObject);
    }
    protected override void Init()
    {
        ItemSkin = transform.Find("itemModel").gameObject;
        ItemSkin.AddComponent <OfferModerItemFunc>();
        UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>();

        uscr.scroRect = ScroRect;
        SetData(994, 200, _arrangement, _upperLimitIndex, _lowerLimitIndex, _cellWidthSpace, _cellHeightSpace, 2);
        // 测试
        //for (int i = 0; i < 20; i++)
        //{
        //    msgs.Add(new ItemData());
        //}
        //Display(msgs);
    }
Beispiel #15
0
 private static void TrySkinChangeItem(ref ItemDefinition template, ref ulong skinId)
 {
     if (skinId == 0L)
     {
         return;
     }
     ItemSkinDirectory.Skin skin = ItemSkinDirectory.FindByInventoryDefinitionId((int)skinId);
     if (skin.id != 0)
     {
         ItemSkin itemSkin = skin.invItem as ItemSkin;
         if (!(itemSkin == null) && !(itemSkin.Redirect == null))
         {
             template = itemSkin.Redirect;
             skinId   = 0uL;
         }
     }
 }
Beispiel #16
0
    protected override void Init()
    {
        ItemSkin = transform.Find("itemSkin").gameObject;
        ItemSkin.AddComponent <EnvironmentItemFunc>();
        UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>();

        uscr.scroRect = ScroRect;
        SetData(262, 80, _arrangement, 6, 20, 0, 20);

        itemList.Add(new EnvironmentItemData("草色青青"));
        itemList.Add(new EnvironmentItemData("高楼林立"));
        itemList.Add(new EnvironmentItemData("街道夜色"));
        itemList.Add(new EnvironmentItemData("无外景"));
        itemList.Add(new EnvironmentItemData("碧水蓝天"));
        itemList.Add(new EnvironmentItemData("绵绵小溪"));

        RefreshDisplay(itemList);
    }
    internal void CopyToSkeleton(Skeleton skeleton, GameObject parent, Item item)
    {
        Func <ItemSkinDirectory.Skin, bool> func = null;

        SkeletonSkin[] skeletonSkins = this.SkeletonSkins;
        for (int i = 0; i < (int)skeletonSkins.Length; i++)
        {
            SkeletonSkin skeletonSkin = skeletonSkins[i];
            GameObject   gameObject   = new GameObject();
            gameObject.transform.parent = parent.transform;
            skeletonSkin.DuplicateAndRetarget(gameObject, skeleton).updateWhenOffscreen = true;
            if (item != null && item.skin > (long)0)
            {
                ItemSkinDirectory.Skin[]            skinArray = item.info.skins;
                Func <ItemSkinDirectory.Skin, bool> func1     = func;
                if (func1 == null)
                {
                    Func <ItemSkinDirectory.Skin, bool> func2 = (ItemSkinDirectory.Skin x) => (long)x.id == item.skin;
                    Func <ItemSkinDirectory.Skin, bool> func3 = func2;
                    func  = func2;
                    func1 = func3;
                }
                ItemSkinDirectory.Skin skin = ((IEnumerable <ItemSkinDirectory.Skin>)skinArray).FirstOrDefault <ItemSkinDirectory.Skin>(func1);
                if (skin.id == 0 && item.skin > (long)0)
                {
                    Rust.Workshop.WorkshopSkin.Apply(gameObject, item.skin, null);
                    return;
                }
                if ((long)skin.id != item.skin)
                {
                    return;
                }
                ItemSkin itemSkin = skin.invItem as ItemSkin;
                if (itemSkin == null)
                {
                    return;
                }
                itemSkin.ApplySkin(gameObject);
            }
        }
    }
    protected override void Init()
    {
        ItemSkin = transform.Find("item").gameObject;

        viewRect.anchoredPosition = Vector2.right * 20;
        //controllerAddDelet = UITool.GetUIComponent<RectTransform>(transform, "Controller");
        //UITool.SetActionTrue(controllerAddDelet.gameObject);
        //controllerMove.SetParent(ContentRectTrans);
        //controllerMove.localScale = Vector3.one;
        //addItem = UITool.GetUIComponent<Button>(ScrollRectTrans, "Add");

        showDelete = UITool.GetUIComponent <Button>(ScrollRectTrans, "Delete");
        showDelete.onClick.AddListener(onDeleteCameraView);
        cancelDelete = UITool.GetUIComponent <Image>(ScrollRectTrans, "Delete/cancelDelete");

        UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>();

        uscr.scroRect = ScroRect;
        ItemSkin.AddComponent <CamereViewItemFunc>();
        _Arranement = Arrangement.Vertical;
        SetData(320, 240, _Arranement, 6, 6, 20, 20);

        viewRect.SetAsFirstSibling();
    }
Beispiel #19
0
    public static bool RegisterPlayer(NetIncomingMessage message)
    {
        string AdminLogin       = message.ReadString();
        string AdminPassword    = message.ReadString();
        string RegisterNickname = message.ReadString();
        string RegisterPassword = message.ReadString();

        PlayerInfo request = MemoryOperations.PlayersData.Keys.FirstOrDefault(x => x.Nickname == AdminLogin);

        if (request.Password == AdminPassword && request.AccessLevel >= 4)
        {
            PlayerInfo newplayer = new PlayerInfo
            {
                Guid           = Guid.NewGuid().ToString(),
                Nickname       = RegisterNickname,
                Password       = RegisterPassword,
                Played_Time    = 0,
                AccessLevel    = 0,
                Deaths         = 0,
                Kills          = 0,
                Score          = 0,
                Level          = 0,
                IsBanned       = false,
                Unlocked_Count = 0
            };
            newplayer.Unlocked_Weapons  = new Dictionary <string, ItemWeapon>();
            newplayer.Unlocked_Skin     = new Dictionary <string, ItemSkin>();
            newplayer.Unlocked_Melee    = new Dictionary <string, ItemMelee>();
            newplayer.Unlocked_Grenages = new Dictionary <string, ItemGrenage>();

            if (MemoryOperations.BalanceData.Weapons != null)
            {
                foreach (var item in MemoryOperations.BalanceData.Weapons)
                {
                    if (item.Value.Unlock_Price == 0 & item.Value.LevelToUnlock == 0)
                    {
                        ItemWeapon addedWeapon = new ItemWeapon
                        {
                            Kills = 0
                        };
                        addedWeapon.Unlocked_Magazines = new List <string>();
                        addedWeapon.Unlocked_Rails     = new List <string>();
                        addedWeapon.Unlocked_Scopes    = new List <string>();
                        addedWeapon.Unlocked_Skins     = new List <string>();
                        addedWeapon.Unlocked_Special   = new List <string>();

                        if (item.Value.Rails != null)
                        {
                            foreach (var rail in item.Value.Rails)
                            {
                                if (rail.Value.Unlock_Price == 0)
                                {
                                    addedWeapon.Unlocked_Rails.Add(rail.Key);
                                }
                            }
                        }

                        if (item.Value.Scopes != null)
                        {
                            foreach (var scope in item.Value.Scopes)
                            {
                                if (scope.Value.Unlock_Price == 0)
                                {
                                    addedWeapon.Unlocked_Scopes.Add(scope.Key);
                                }
                            }
                        }

                        if (item.Value.Magazines != null)
                        {
                            foreach (var magazine in item.Value.Magazines)
                            {
                                if (magazine.Value.Unlock_Price == 0)
                                {
                                    addedWeapon.Unlocked_Magazines.Add(magazine.Key);
                                }
                            }
                        }

                        if (item.Value.Special != null)
                        {
                            foreach (var special in item.Value.Special)
                            {
                                if (special.Value.Unlock_Price == 0)
                                {
                                    addedWeapon.Unlocked_Special.Add(special.Key);
                                }
                            }
                        }

                        if (item.Value.Skins != null)
                        {
                            foreach (var skin in item.Value.Skins)
                            {
                                if (skin.Value.Unlock_Price == 0)
                                {
                                    addedWeapon.Unlocked_Skins.Add(skin.Key);
                                }
                            }
                        }

                        newplayer.Unlocked_Weapons.Add(item.Key, addedWeapon);
                    }
                }
            }

            if (MemoryOperations.BalanceData.Skins != null)
            {
                foreach (var item in MemoryOperations.BalanceData.Skins)
                {
                    if (item.Value.Unlock_Price == 0 & item.Value.LevelToUnlock == 0)
                    {
                        ItemSkin addSkin = new ItemSkin
                        {
                            Kills = 0
                        };
                        addSkin.Unlocked_Skins = new List <string>();

                        if (item.Value.Skins != null)
                        {
                            foreach (var skin in item.Value.Skins)
                            {
                                if (skin.Value.Unlock_Price == 0)
                                {
                                    addSkin.Unlocked_Skins.Add(skin.Key);
                                }
                            }
                        }
                        newplayer.Unlocked_Skin.Add(item.Key, addSkin);
                    }
                }
            }

            /*
             * if (MemoryOperations.BalanceData.Knifes != null)
             * {
             *  foreach (var item in MemoryOperations.BalanceData.Knifes)
             *  {
             *      if (item.Value.Unlock_Price == 0 & item.Value.LevelToUnlock == 0)
             *      {
             *          ItemMelee addMelee = new ItemMelee
             *          {
             *              Kills = 0
             *          };
             *          addMelee.Unlocked_Skins = new List<string>();
             *
             *          if (item.Value.Skins != null)
             *          {
             *              foreach (var skin in item.Value.Skins)
             *              {
             *                  if (skin.Value.Unlock_Price == 0)
             *                  {
             *                      addMelee.Unlocked_Skins.Add(skin.Key);
             *                  }
             *              }
             *          }
             *
             *          newplayer.Unlocked_Melee.Add(item.Key, addMelee);
             *      }
             *  }
             * }
             *//*
             * if (MemoryOperations.BalanceData.Knifes != null)
             * {
             *  foreach (var item in MemoryOperations.BalanceData.Grenages)
             *  {
             *      if (item.Value.Unlock_Price == 0 & item.Value.LevelToUnlock == 0)
             *      {
             *          ItemGrenage addGrenage = new ItemGrenage
             *          {
             *              Kills = 0
             *          };
             *          addGrenage.Unlocked_Skins = new List<string>();
             *
             *          if (item.Value.Skins != null)
             *          {
             *              foreach (var skin in item.Value.Skins)
             *              {
             *                  if (skin.Value.Unlock_Price == 0)
             *                  {
             *                      addGrenage.Unlocked_Skins.Add(skin.Key);
             *                  }
             *              }
             *          }
             *          newplayer.Unlocked_Grenages.Add(item.Key, addGrenage);
             *      }
             *  }
             * }*/

            bool success = false;
            while (!success)
            {
                success = MemoryOperations.PlayersData.TryAdd(newplayer, true);
            }
            Console.WriteLine("Registered {0} {1}", newplayer.Nickname, newplayer.Guid);
            return(true);
        }
        else
        {
            return(false);
        }
    }