/// <summary>
    /// チェックボックスアイテムセット
    /// </summary>
    public void SetCheckBox(UserGearData data, bool isEquipped, uint isLock, uint checkFlg, Action <ItemInventoryGearScrollViewItem> onClick)
    {
        this.gearData = data;
        // CommonIconをギアに変更
        this.commonIcon.SetGearCommonIcon(true);
        var gearMaster = Masters.GearDB.FindById(data.gearId);

        // ランクスプライト切替
        var rank = CommonIconUtility.GetRarity((uint)ItemType.Gear, this.gearData.gearId);

        this.commonIcon.SetRank(rank);

        // ギアCommonIconセット
        var bgSprite   = CommonIconUtility.GetGearBgSprite(data.gearType);
        var mainSprite = CommonIconUtility.GetGearMainImageSprite(gearMaster.key);
        var subSprite  = CommonIconUtility.GetGearSubImageSprite(gearMaster.subKey);

        this.commonIcon.SetGearSprite(bgSprite, mainSprite, subSprite);

        // 装着中ギア装着中パンネル表示
        this.equippedMark.SetActive(isEquipped);

        // クリック時処理登録
        this.commonIcon.onClick = () => onClick(this);

        // // ロック情報セット
        SetTemplockImage(isLock);

        // ロックの場合はクリック禁止・イメージ暗く
        if (isEquipped || isLock == 1)
        {
            this.commonIcon.button.interactable = false;

            // 色暗く
            var newColor = new Color(130 / 255f, 130 / 255f, 130 / 255f);
            this.commonIconGearBgGraphic.color   = newColor;
            this.commonIconGearMainGraphic.color = newColor;
            this.commonIconGearSubGraphic.color  = newColor;

            this.checkBox.SetActive(false);
        }
        // チェックボックスセット
        else
        {
            this.commonIcon.button.interactable = true;

            // 色の原本で
            var newColor = new Color(255 / 255f, 255 / 255f, 255 / 255f);
            this.commonIconGearBgGraphic.color   = newColor;
            this.commonIconGearMainGraphic.color = newColor;
            this.commonIconGearSubGraphic.color  = newColor;

            this.checkBox.SetActive(true);
            //クリック時処理登録
            this.commonIcon.onClick = () => onClick(this);
        }

        // 仮選択フラッグチェックセット
        SetTempCheckImage(checkFlg);
    }
    /// <summary>
    /// 表示構築
    /// </summary>
    public void Set(UserGearData data, bool isEquipped, uint isLock, Action <ItemInventoryGearScrollViewItem> onClick)
    {
        this.gearData = data;
        // CommonIconをギアに変更
        this.commonIcon.SetGearCommonIcon(true);
        var gearMaster = Masters.GearDB.FindById(data.gearId);

        // ランクスプライト切替
        var rank = CommonIconUtility.GetRarity((uint)ItemType.Gear, this.gearData.gearId);

        this.commonIcon.SetRank(rank);

        // ギアCommonIconセット、アイコンスプライト切替
        var bgSprite   = CommonIconUtility.GetGearBgSprite(data.gearType);
        var mainSprite = CommonIconUtility.GetGearMainImageSprite(gearMaster.key);
        var subSprite  = CommonIconUtility.GetGearSubImageSprite(gearMaster.subKey);

        this.commonIcon.SetGearSprite(bgSprite, mainSprite, subSprite);

        // 装着中ギア装着中パンネル表示
        this.equippedMark.SetActive(isEquipped);

        // クリック時処理登録
        this.commonIcon.onClick = () => onClick(this);

        // ロック情報セット
        SetTemplockImage(isLock);
    }
Пример #3
0
    /// <summary>
    /// 表示構築
    /// </summary>
    public void SetGearData(UserGearData data, Action <CustomGearScrollViewItem> onClick)
    {
        this.gearData = data;
        this.onClick  = onClick;
        var localizeText = Masters.LocalizeTextDB;

        if (data == null)
        {
            this.removeViewObject.SetActive(true);
        }
        else
        {
            var config = Masters.ConfigDB.FindById(1);
            //各能力のMAX値(仮)
            var MAX_POWER              = config.maxGearPower;
            var MAX_BULLET_SPEED       = config.maxGearSpeed;
            var MAX_FV_POINT_GET_VALUE = config.maxGearFvPoint;

            // 歯車能力値
            var  master          = Masters.GearDB.FindById(this.gearData.gearId);
            uint power           = master.power;
            uint bulletSpeed     = master.speed;
            uint fvPointGetValue = master.fvPoint;

            //攻撃力ゲージ設定
            this.powerGauge.SetGaugeValue(Mathf.Clamp01((float)power / MAX_POWER));

            //発射速度ゲージ設定
            this.bulletSpeedGauge.SetGaugeValue(Mathf.Clamp01((float)bulletSpeed / MAX_BULLET_SPEED));

            //FVポイント獲得値ゲージ設定
            this.fvPointGetValueGauge.SetGaugeValue(Mathf.Clamp01((float)fvPointGetValue / MAX_FV_POINT_GET_VALUE));

            //ランクスプライト
            this.commonIcon.SetRank((Rank)master.rarity);

            // CommonIconをギアに変更
            this.commonIcon.SetGearCommonIcon(true);

            // ギアCommonIconセット
            var bgSprite   = CommonIconUtility.GetGearBgSprite(this.gearData.gearType);
            var mainSprite = CommonIconUtility.GetGearMainImageSprite(master.key);
            var subSprite  = CommonIconUtility.GetGearSubImageSprite(master.subKey);
            this.commonIcon.SetGearSprite(bgSprite, mainSprite, subSprite);

            //ギアInfo
            this.gearName.text        = master.name;
            this.gearDescription.text = master.description;

            // localize
            this.powerGaugeText.text           = localizeText.Get("Power");
            this.bulletSpeedGaugeText.text     = localizeText.Get("BulletSpeed");
            this.fvPointGetValueGaugeText.text = localizeText.GetFormat("FvPointGetValue");
        }
    }
Пример #4
0
    /// <summary>
    /// セット
    /// </summary>
    public void Set(IItemInfo itemInfo, bool setLongPress)
    {
        if (setLongPress)
        {
            this.onLongPress = () =>
            {
                this.infoDialogData.OpenDialog(itemInfo);
            };
        }

        if (itemInfo is Master.GearData)
        {
            var gearData = itemInfo as Master.GearData;

            //ギア表示ON
            this.SetGearCommonIcon(true);

            //スプライト設定
            this.SetGearSprite(
                bgSprite: CommonIconUtility.GetGearBgSprite(gearData.partsType),
                mainSprite: CommonIconUtility.GetGearMainImageSprite(gearData.key),
                subSprite: CommonIconUtility.GetGearSubImageSprite(gearData.subKey)
                );
        }
        else
        {
            //ギア表示OFF
            this.SetGearCommonIcon(false);

            Sprite sprite = null;

            if (itemInfo.IsCommonSprite())
            {
                sprite = SharedUI.Instance.commonAtlas.GetSprite(itemInfo.GetSpritePath());
            }
            else
            {
                var spritePath = itemInfo.GetSpritePath();
                sprite = AssetManager.FindHandle <Sprite>(spritePath).asset as Sprite;
            }

            //スプライト設定
            this.SetIconSprite(sprite);
        }

        //ランク設定
        var rank = itemInfo.GetRank();

        this.SetRank(rank);
    }
Пример #5
0
    /// <summary>
    /// ギアスロットボタンセット
    /// </summary>
    public void SetUp(
        UserPartsData data,
        uint gearId,
        bool isExtended,
        Action <CustomTurretGearSlotButton> onClick)
    {
        this.partsData  = data;
        this.gearId     = gearId;
        this.isExtended = isExtended;
        this.onClick    = onClick;

        //ギア装着・スロット解除の情報チェック
        this.BeforeGearEquipSlot.SetActive(isExtended);
        this.AfterGearEquipSlot.SetActive(isExtended && gearId > 0);

        //名前、説明文表示切替のリセット
        this.timeCount = 0f;
        this.gearNameText.gameObject.SetActive(true);
        this.info.gameObject.SetActive(false);

        //未装着
        if (gearId == 0)
        {
            this.gearNameText.text = null;
            this.info.text         = null;
        }
        //装備中
        else
        {
            var master = Masters.GearDB.FindById(gearId);
            this.gearIcon.SetRank((Rank)master.rarity);

            // CommonIconをギアに変更
            this.gearIcon.SetGearCommonIcon(true);

            // TODO. ギアデータセット
            var partsType = master.partsType;
            // TODO. ギアCommonIconセット
            var bgSprite   = CommonIconUtility.GetGearBgSprite(partsType);
            var mainSprite = CommonIconUtility.GetGearMainImageSprite(master.key);
            var subSprite  = CommonIconUtility.GetGearSubImageSprite(master.subKey);
            this.gearIcon.SetGearSprite(bgSprite, mainSprite, subSprite);

            this.gearNameText.text = master.name;
            this.info.text         = master.description;
        }
    }
        /// <summary>
        /// ギア情報のセット
        /// </summary>
        public void SetGearData(Master.GearData gearData)
        {
            if (gearData == null)
            {
                this.icon.gameObject.SetActive(false);
                this.nameText.gameObject.SetActive(false);
            }
            else
            {
                this.icon.SetGearCommonIcon(true);
                ;
                this.icon.SetRank((Rank)gearData.rarity);
                this.nameText.text = gearData.name;
                this.notEquipedText.gameObject.SetActive(false);

                // ギアスプライトセット
                var bgSprite   = CommonIconUtility.GetGearBgSprite(gearData.partsType);
                var mainSprite = CommonIconUtility.GetGearMainImageSprite(gearData.key);
                var subSprite  = CommonIconUtility.GetGearSubImageSprite(gearData.subKey);

                this.icon.SetGearSprite(bgSprite, mainSprite, subSprite);
            }
        }