Ejemplo n.º 1
0
        private void onObjectAdded(RectTransform item, int index)
        {
            CustomizationButton component        = item.GetComponent <CustomizationButton>();
            FabricDefinition    fabricDefinition = displayedFabrics[index];

            component.gameObject.name = fabricDefinition.AssetName + "_button";
            RectTransform rectTransform = component.transform as RectTransform;

            rectTransform.anchoredPosition = Vector2.zero;
            rectTransform.anchorMin        = Vector2.zero;
            rectTransform.anchorMax        = Vector2.one;
            rectTransform.sizeDelta        = Vector2.zero;
            rectTransform.localScale       = Vector3.one;
            bool canDrag = isLocalPlayerMember;

            if (!isLocalPlayerMember)
            {
                canDrag = !fabricDefinition.IsMemberOnly;
            }
            if (Service.Get <CatalogServiceProxy>().IsCatalogThemeActive())
            {
                canDrag = true;
            }
            Texture2DContentKey fabricPath = EquipmentPathUtil.GetFabricPath(fabricDefinition.AssetName);

            component.Init(fabricPath, BreadcrumbType, fabricDefinition.Id, canDrag);
            AccessibilitySettings component2 = component.GetComponent <AccessibilitySettings>();

            if (component2 != null)
            {
                component2.CustomToken = fabricDefinition.AssetName;
            }
        }
Ejemplo n.º 2
0
    protected override void createItem(DecalDefinition itemDefinition, GameObject item, ItemGroup.LockedState lockedState)
    {
        CustomizationButton component = item.GetComponent <CustomizationButton>();
        bool canDrag = lockedState == ItemGroup.LockedState.Unlocked;
        Texture2DContentKey fabricPath = EquipmentPathUtil.GetFabricPath(itemDefinition.AssetName);

        component.Init(fabricPath, BreadcrumbType, itemDefinition.Id, canDrag);
    }
Ejemplo n.º 3
0
    private IEnumerator renderPattern(int unlockID)
    {
        Dictionary <int, FabricDefinition> decals = Service.Get <GameData>().Get <Dictionary <int, FabricDefinition> >();
        Texture2DContentKey iconContentKey        = RewardPopupConstants.DefaultIconContentKey;

        if (decals.TryGetValue(unlockID, out FabricDefinition definition))
        {
            iconContentKey = EquipmentPathUtil.GetFabricPath(definition.AssetName);
        }
        AssetRequest <Texture2D> assetRequest = Content.LoadAsync(iconContentKey);

        yield return(assetRequest);

        callback(Sprite.Create(assetRequest.Asset, new Rect(0f, 0f, assetRequest.Asset.width, assetRequest.Asset.height), Vector2.zero), null);
    }