先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
62 lines
2.0 KiB
C#
62 lines
2.0 KiB
C#
using asap.core;
|
|
using DG.Tweening;
|
|
using game;
|
|
using GameCore;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class BonusReward : MonoBehaviour
|
|
{
|
|
RewardItemNew[] reward_extra;
|
|
List<int> showCount = new List<int>();
|
|
List<int> showAddCount = new List<int>();
|
|
public void Show()
|
|
{
|
|
ShowBonusCount(1);
|
|
}
|
|
public void Show(int magnification)
|
|
{
|
|
ShowBonusCount(magnification);
|
|
}
|
|
void ShowBonusCount(int magnification)
|
|
{
|
|
reward_extra = GetComponentsInChildren<RewardItemNew>(true);
|
|
FishingStage fishingStage = GContext.container.ResolveStage("FishingStage") as FishingStage;
|
|
List<TargetAddData> itemDatas = fishingStage.q_TargetShowData;
|
|
int j = 0;
|
|
if (itemDatas != null)
|
|
{
|
|
for (int i = 0; i < itemDatas.Count; i++)
|
|
{
|
|
TargetAddData data = itemDatas[i];
|
|
if (data.id != 1002 && data.id != 1001)
|
|
{
|
|
int count = data.addCount / magnification;
|
|
showCount.Add(count);
|
|
showAddCount.Add(data.addCount - count);
|
|
reward_extra[j].SetData(new ItemData() { id = data.id, count = count });
|
|
reward_extra[j].gameObject.SetActive(true);
|
|
j++;
|
|
if (j >= reward_extra.Length)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
gameObject.SetActive(j > 0);
|
|
}
|
|
public void DOTweenAdd(int magnification, float duration)
|
|
{
|
|
var progress = 0f;
|
|
DOTween.To(() => progress, x => progress = x, 1f, duration).OnUpdate(() =>
|
|
{
|
|
for (int i = 0; i < showCount.Count; i++)
|
|
{
|
|
reward_extra[i].text_num.text = $"x{ConvertTools.GetNumberString2((int)(showCount[i] + showAddCount[i] * progress))}";
|
|
}
|
|
}).SetId("AddCash");
|
|
}
|
|
}
|