店舗開放処理追加 WorldMap.cs
This commit is contained in:
parent
46be4da4c7
commit
28f9fc3961
|
|
@ -856,11 +856,13 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 4e4f24e6699341769dc47066fac7fa38, type: 3}
|
m_Script: {fileID: 11500000, guid: 4e4f24e6699341769dc47066fac7fa38, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
titleText: {fileID: 0}
|
titleText: {fileID: 6623300116970052218}
|
||||||
levelText: {fileID: 0}
|
levelText: {fileID: 6623300116824560410}
|
||||||
iconTarget: {fileID: 0}
|
iconTarget: {fileID: 6623300117055383976}
|
||||||
progressSlider: {fileID: 0}
|
progressSlider: {fileID: 6623300116374396847}
|
||||||
button: {fileID: 0}
|
button: {fileID: 6623300115501561980}
|
||||||
|
brotherPanel: {fileID: 6960725688910489147}
|
||||||
|
partTimerPanel: {fileID: 8891951417021859415}
|
||||||
--- !u!1 &6623300116695627431
|
--- !u!1 &6623300116695627431
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -1203,7 +1205,7 @@ GameObject:
|
||||||
- component: {fileID: 6623300117055383982}
|
- component: {fileID: 6623300117055383982}
|
||||||
- component: {fileID: 6623300117055383983}
|
- component: {fileID: 6623300117055383983}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: icon
|
m_Name: iconTarget
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
|
|
@ -1220,7 +1222,8 @@ RectTransform:
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children:
|
||||||
|
- {fileID: 1202312085019358080}
|
||||||
m_Father: {fileID: 6623300116529072775}
|
m_Father: {fileID: 6623300116529072775}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
|
@ -1576,3 +1579,79 @@ RectTransform:
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 100, y: 100}
|
m_SizeDelta: {x: 100, y: 100}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!1 &9157707049469892783
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1202312085019358080}
|
||||||
|
- component: {fileID: 7696835910450672046}
|
||||||
|
- component: {fileID: 5469095571207879549}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: icon
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &1202312085019358080
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9157707049469892783}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 6623300117055383976}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: 0, y: -0}
|
||||||
|
m_SizeDelta: {x: 118, y: 118}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &7696835910450672046
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9157707049469892783}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &5469095571207879549
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9157707049469892783}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 21300000, guid: 34b365f4d93bfac4fb472f0a176ec998, type: 3}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using TMPro;
|
||||||
using UniRx;
|
using UniRx;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
@ -8,23 +9,25 @@ namespace MyGame.Scenes.WorldMap.Scripts
|
||||||
public class EarningView : MonoBehaviour
|
public class EarningView : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] private Text titleText;
|
[SerializeField] private Text titleText;
|
||||||
[SerializeField] private Text levelText;
|
[SerializeField] private TextMeshProUGUI levelText;
|
||||||
[SerializeField] private Transform iconTarget;
|
[SerializeField] private Transform iconTarget;
|
||||||
[SerializeField] private Slider progressSlider;
|
[SerializeField] private Slider progressSlider;
|
||||||
[SerializeField] private Button button;
|
[SerializeField] private Button button;
|
||||||
private readonly CompositeDisposable compositeDisposable = new();
|
[SerializeField] private GameObject brotherPanel;
|
||||||
|
[SerializeField] private GameObject partTimerPanel;
|
||||||
private void Start()
|
public IObservable<Unit> OnClick => button.OnClickAsObservable().TakeUntilDestroy(this);
|
||||||
|
|
||||||
|
public void SetLatestCity(bool active)
|
||||||
{
|
{
|
||||||
compositeDisposable.AddTo(this);
|
brotherPanel.SetActive(active);
|
||||||
|
partTimerPanel.SetActive(!active);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetData(PartTimerData partTimerData, float progressValue, Action onClick = null)
|
public void SetData(CityData cityData, PartTimerData partTimerData, float progressValue)
|
||||||
{
|
{
|
||||||
|
titleText.text = cityData.Name;
|
||||||
levelText.text = $"Lv.{partTimerData.level}";
|
levelText.text = $"Lv.{partTimerData.level}";
|
||||||
progressSlider.value = progressValue;
|
progressSlider.value = progressValue;
|
||||||
compositeDisposable.Clear();
|
|
||||||
button.OnClickAsObservable().Take(1).Subscribe(_ => onClick?.Invoke()).AddTo(compositeDisposable);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -15,12 +15,7 @@ namespace MyGame.Scenes.WorldMap.Scripts
|
||||||
[SerializeField] private GameObject fundButtonOff;
|
[SerializeField] private GameObject fundButtonOff;
|
||||||
[SerializeField] private GameObject detailObject;
|
[SerializeField] private GameObject detailObject;
|
||||||
[SerializeField] private GameObject hideObject;
|
[SerializeField] private GameObject hideObject;
|
||||||
private readonly CompositeDisposable compositeDisposable = new();
|
public IObservable<Unit> OnFund => fundButton.OnClickAsObservable().TakeUntilDestroy(this);
|
||||||
|
|
||||||
private void Start()
|
|
||||||
{
|
|
||||||
compositeDisposable.AddTo(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetActive(bool active)
|
public void SetActive(bool active)
|
||||||
{
|
{
|
||||||
|
|
@ -30,15 +25,15 @@ namespace MyGame.Scenes.WorldMap.Scripts
|
||||||
|
|
||||||
public void SetData(FundingData fundingData, int funded, Action<int> onComplete = null)
|
public void SetData(FundingData fundingData, int funded, Action<int> onComplete = null)
|
||||||
{
|
{
|
||||||
fundButtonOff.SetActive(funded / fundingData.needAmount != 1);
|
fundButtonOff.SetActive(funded / fundingData.needAmount >= 1);
|
||||||
fundButton.gameObject.SetActive(!fundButtonOff.activeSelf);
|
fundButton.gameObject.SetActive(!fundButtonOff.activeSelf);
|
||||||
progressSlider.value = (float)funded / fundingData.needAmount;
|
SetSlider(funded, fundingData.needAmount);
|
||||||
progressText.text = $"{funded}/{fundingData.needAmount}";
|
}
|
||||||
compositeDisposable.Clear();
|
|
||||||
fundButton.OnClickAsObservable().ThrottleFirst(TimeSpan.FromSeconds(1f)).Subscribe(_ =>
|
private void SetSlider(float value, float max)
|
||||||
{
|
{
|
||||||
FundingDialog.ShowDialog(fundingData, onComplete);
|
progressSlider.value = value / max;
|
||||||
}).AddTo(compositeDisposable);
|
progressText.text = $"{value}/{max}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using MyGame.Scripts;
|
||||||
using UniRx;
|
using UniRx;
|
||||||
using UniRx.Triggers;
|
using UniRx.Triggers;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
@ -17,9 +18,11 @@ namespace MyGame.Scenes.WorldMap.Scripts
|
||||||
[SerializeField] private EarningView earningView;
|
[SerializeField] private EarningView earningView;
|
||||||
[SerializeField] private float selectDuration = 1f;
|
[SerializeField] private float selectDuration = 1f;
|
||||||
[SerializeField] private float zoomScale = 1f;
|
[SerializeField] private float zoomScale = 1f;
|
||||||
|
private readonly CompositeDisposable citySelectDisposable = new();
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
citySelectDisposable.AddTo(this);
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
this.UpdateAsObservable()
|
this.UpdateAsObservable()
|
||||||
.Where(_ => Input.GetKeyDown(KeyCode.R))
|
.Where(_ => Input.GetKeyDown(KeyCode.R))
|
||||||
|
|
@ -51,7 +54,7 @@ namespace MyGame.Scenes.WorldMap.Scripts
|
||||||
fundingView.gameObject.SetActive(false);
|
fundingView.gameObject.SetActive(false);
|
||||||
earningView.gameObject.SetActive(false);
|
earningView.gameObject.SetActive(false);
|
||||||
var beginPos = content.localPosition;
|
var beginPos = content.localPosition;
|
||||||
var endPos = new Vector3(contentOffset.y, contentOffset.x + (beginPos - contentOffset).x / zoomScale);
|
var endPos = new Vector3(contentOffset.x + (beginPos - contentOffset).x / zoomScale, contentOffset.y);
|
||||||
this.CallLerp(selectDuration, f =>
|
this.CallLerp(selectDuration, f =>
|
||||||
{
|
{
|
||||||
var scale = Mathf.Lerp(zoomScale, 1f, f);
|
var scale = Mathf.Lerp(zoomScale, 1f, f);
|
||||||
|
|
@ -64,37 +67,50 @@ namespace MyGame.Scenes.WorldMap.Scripts
|
||||||
shareGate = true;
|
shareGate = true;
|
||||||
});
|
});
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 初期実装都市のデータ設定
|
||||||
|
*/
|
||||||
|
gameData.IsFundingCompleted = true;
|
||||||
|
GameDataUtils.CreateCityData(2);
|
||||||
|
|
||||||
foreach (var cityIcon in cityIcons)
|
foreach (var cityIcon in cityIcons)
|
||||||
{
|
{
|
||||||
/*
|
cityIcon.SetNotify(false);
|
||||||
* CityIconからCityIdを取得
|
var cityData = cityDataList.FirstOrDefault(data => data.id == cityIcon.CityId);
|
||||||
* 資金データを取得
|
|
||||||
* 資金調達達成orバイト進捗50%以上であればNotifyアイコンフラグ
|
|
||||||
*/
|
|
||||||
var cityGameData = GameDataManager.GetCityGameData(cityIcon.CityId);
|
var cityGameData = GameDataManager.GetCityGameData(cityIcon.CityId);
|
||||||
|
if (cityGameData is null)
|
||||||
|
{
|
||||||
|
cityIcon.SetState(CityState.UnRelease);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// バイト収益
|
cityIcon.SetState(cityGameData.IsFundingCompleted ? CityState.Release : CityState.Lock);
|
||||||
var partTimerLevel = cityGameData.PartTimerLevel;
|
|
||||||
var cityPartTimerDataList = partTimerDataList.Where(x => x.cityId == cityIcon.CityId).ToList();
|
|
||||||
var partTimerData = cityPartTimerDataList.FirstOrDefault(data => data.level == partTimerLevel);
|
|
||||||
|
|
||||||
|
// 資金調達達成に関わらずバイト情報取得
|
||||||
|
var partTimerData = partTimerDataList.FirstOrDefault(data => data.level == cityGameData.PartTimerLevel);
|
||||||
if (partTimerData != null)
|
if (partTimerData != null)
|
||||||
{
|
{
|
||||||
var heartProgress = partTimerData.heart / 10 * cityGameData.PartTimerElapsed / partTimerData.maxHeart;
|
// リアルタイムでバッジ表示も可能
|
||||||
var coinProgress = partTimerData.sales / 10 * cityGameData.PartTimerElapsed / partTimerData.maxSales;
|
// progress >= 50% で通知
|
||||||
// progress >= 50% で通知アイコン
|
var (heartProgress, coinProgress) = CalcPartTimerProgress(partTimerData, cityGameData.PartTimerElapsed);
|
||||||
|
if (Mathf.Max(heartProgress, coinProgress) >= .5f)
|
||||||
|
{
|
||||||
|
cityIcon.SetNotify(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// バイト強化可能か判定
|
// バイト強化可能か判定
|
||||||
var nextLevelData = cityPartTimerDataList.FirstOrDefault(data => data.level == partTimerLevel + 1);
|
var nextLevelData = partTimerDataList.FirstOrDefault(data => data.level == cityGameData.PartTimerLevel + 1);
|
||||||
if (nextLevelData != null)
|
if (nextLevelData != null)
|
||||||
{
|
{
|
||||||
// 都市が開放されてから兄弟が働いて獲得したハートの合計
|
// 都市が開放されてから兄弟が働いて獲得したハートの合計
|
||||||
if (nextLevelData.needHeart <= GameDataManager.GetCityGameData(nextLevelData.needHeartCityId).Heart)
|
if (nextLevelData.needHeart <= GameDataUtils.GetPartTimerHeart(nextLevelData.cityId))
|
||||||
{
|
{
|
||||||
if (nextLevelData.needAmount <= cityGameData.Coin)
|
if (nextLevelData.needAmount <= cityGameData.Coin)
|
||||||
{
|
{
|
||||||
// 強化可能
|
// 強化可能
|
||||||
|
cityIcon.SetNotify(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -103,58 +119,96 @@ namespace MyGame.Scenes.WorldMap.Scripts
|
||||||
.Where(_ => shareGate)
|
.Where(_ => shareGate)
|
||||||
.ThrottleFirst(TimeSpan.FromSeconds(1f))
|
.ThrottleFirst(TimeSpan.FromSeconds(1f))
|
||||||
.Subscribe(_ =>
|
.Subscribe(_ =>
|
||||||
|
{
|
||||||
|
shareGate = false;
|
||||||
|
citySelectDisposable.Clear();
|
||||||
|
|
||||||
|
// 都市が最新店舗かどうか判定
|
||||||
|
earningView.SetLatestCity(GameDataUtils.CheckLatestCity(cityIcon.CityId));
|
||||||
|
|
||||||
|
// バイト進捗
|
||||||
|
if (partTimerData != null)
|
||||||
{
|
{
|
||||||
shareGate = false;
|
var (heartProgress, coinProgress) = CalcPartTimerProgress(partTimerData, cityGameData.PartTimerElapsed);
|
||||||
|
earningView.SetData(cityData, partTimerData, Mathf.Max(heartProgress, coinProgress));
|
||||||
var isFunded = true;
|
earningView.OnClick.Subscribe(_ =>
|
||||||
fundingView.ResetView();
|
|
||||||
var index = 0;
|
|
||||||
// 資金調達進捗
|
|
||||||
foreach (var fundingData in fundingDataList.Where(x => x.cityId == cityIcon.CityId))
|
|
||||||
{
|
{
|
||||||
var now = cityGameData.FundingDict[fundingData.fundingCityId];
|
gameData.CurrentCityId = cityIcon.CityId;
|
||||||
isFunded &= now >= fundingData.needAmount;
|
TransitionManager.Instance.LoadScene(GameScenes.Main);
|
||||||
fundingView.SelectViews[index].SetActive(true);
|
}).AddTo(citySelectDisposable);
|
||||||
fundingView.SelectViews[index].SetData(fundingData, now, amount =>
|
}
|
||||||
|
fundingView.ResetView();
|
||||||
|
fundingView.SetData(cityData);
|
||||||
|
var index = 0;
|
||||||
|
// 資金調達進捗
|
||||||
|
var filteredFundingList = fundingDataList.Where(data => data.cityId == cityIcon.CityId).ToList();
|
||||||
|
foreach (var fundingData in filteredFundingList)
|
||||||
|
{
|
||||||
|
cityGameData.FundingDict.TryAdd(fundingData.fundingCityId, 0);
|
||||||
|
var view = fundingView.SelectViews[index];
|
||||||
|
view.SetActive(true);
|
||||||
|
view.SetData(fundingData, cityGameData.FundingDict[fundingData.fundingCityId]);
|
||||||
|
view.OnFund.ThrottleFirst(TimeSpan.FromSeconds(1f)).Subscribe(_ =>
|
||||||
|
{
|
||||||
|
FundingDialog.ShowDialog(fundingData, amount =>
|
||||||
{
|
{
|
||||||
// 資金投入
|
// 資金投入
|
||||||
cityGameData.FundingDict[fundingData.fundingCityId] += amount;
|
cityGameData.FundingDict[fundingData.fundingCityId] += amount;
|
||||||
GameDataManager.GetCityGameData(fundingData.fundingCityId).Coin -= amount;
|
GameDataManager.GetCityGameData(fundingData.fundingCityId).Coin -= amount;
|
||||||
|
cityGameData.IsFundingCompleted = filteredFundingList.All(data => cityGameData.FundingDict[data.fundingCityId] >= data.needAmount);
|
||||||
GameDataManager.SaveGameData();
|
GameDataManager.SaveGameData();
|
||||||
|
// view更新
|
||||||
// 調達完了でPopup
|
view.SetData(fundingData, cityGameData.FundingDict[fundingData.fundingCityId]);
|
||||||
|
if (!cityGameData.IsFundingCompleted)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 都市開放演出
|
||||||
|
shareGate = false;
|
||||||
|
earningView.gameObject.SetActive(false);
|
||||||
|
fundingView.gameObject.SetActive(false);
|
||||||
|
cityIcon.PlayAnimation(() =>
|
||||||
|
{
|
||||||
|
cityIcon.SetState(CityState.Release);
|
||||||
|
FoodStandDialog.ShowDialog(cityData, () =>
|
||||||
|
{
|
||||||
|
earningView.SetLatestCity(true);
|
||||||
|
// popup表示
|
||||||
|
earningView.gameObject.SetActive(true);
|
||||||
|
fundingView.gameObject.SetActive(false);
|
||||||
|
shareGate = true;
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
index++;
|
}).AddTo(citySelectDisposable);
|
||||||
}
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
// バイト進捗&都市に行く
|
// 地図操作
|
||||||
if (isFunded)
|
var beginPos = content.localPosition;
|
||||||
{
|
var endPos = contentOffset + (selectedPos - cityIcon.transform.localPosition) * zoomScale;
|
||||||
if (partTimerData != null)
|
this.CallLerp(selectDuration, f =>
|
||||||
{
|
{
|
||||||
var heartProgress = partTimerData.heart / 10 * cityGameData.PartTimerElapsed / partTimerData.maxHeart;
|
var scale = Mathf.Lerp(1f, zoomScale, f);
|
||||||
var coinProgress = partTimerData.sales / 10 * cityGameData.PartTimerElapsed / partTimerData.maxSales;
|
content.localPosition = Vector3.Lerp(beginPos, endPos, f);
|
||||||
earningView.SetData(partTimerData, Mathf.Max(heartProgress, coinProgress));
|
content.SetLocalScale(scale);
|
||||||
}
|
}, () =>
|
||||||
}
|
{
|
||||||
|
// popup表示
|
||||||
var beginPos = content.localPosition;
|
earningView.gameObject.SetActive(cityGameData.IsFundingCompleted);
|
||||||
var endPos = contentOffset + (selectedPos - cityIcon.transform.localPosition) * zoomScale;
|
fundingView.gameObject.SetActive(!earningView.isActiveAndEnabled);
|
||||||
this.CallLerp(selectDuration, f =>
|
cancelWall.SetActive(true);
|
||||||
{
|
shareGate = true;
|
||||||
var scale = Mathf.Lerp(1f, zoomScale, f);
|
});
|
||||||
content.localPosition = Vector3.Lerp(beginPos, endPos, f);
|
}).AddTo(cityIcon);
|
||||||
content.SetLocalScale(scale);
|
|
||||||
}, () =>
|
|
||||||
{
|
|
||||||
// popup表示
|
|
||||||
fundingView.gameObject.SetActive(!isFunded);
|
|
||||||
earningView.gameObject.SetActive(isFunded);
|
|
||||||
cancelWall.SetActive(true);
|
|
||||||
shareGate = true;
|
|
||||||
});
|
|
||||||
}).AddTo(cityIcon);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static (float heartProgress, float coinProgress) CalcPartTimerProgress(PartTimerData partTimerData, int elapsed)
|
||||||
|
{
|
||||||
|
var heartProgress = partTimerData.heart / 10 * elapsed / partTimerData.maxHeart;
|
||||||
|
var coinProgress = partTimerData.sales / 10 * elapsed / partTimerData.maxSales;
|
||||||
|
return (heartProgress, coinProgress);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2001,6 +2001,7 @@ MonoBehaviour:
|
||||||
selectedCityTarget: {fileID: 793599774}
|
selectedCityTarget: {fileID: 793599774}
|
||||||
cityIcons:
|
cityIcons:
|
||||||
- {fileID: 1393332535}
|
- {fileID: 1393332535}
|
||||||
|
- {fileID: 1933194629}
|
||||||
scrollRect: {fileID: 1967067868}
|
scrollRect: {fileID: 1967067868}
|
||||||
cancelWall: {fileID: 1834691514}
|
cancelWall: {fileID: 1834691514}
|
||||||
fundingView: {fileID: 1232183326}
|
fundingView: {fileID: 1232183326}
|
||||||
|
|
@ -2644,6 +2645,18 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1892482190}
|
m_GameObject: {fileID: 1892482190}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &1933194629 stripped
|
||||||
|
MonoBehaviour:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 2440113195234058918, guid: 3fd9701b4f03eb043814a62cebedf574,
|
||||||
|
type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 697966914}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 94d22fb4b30547a7a7d613555c1fd8da, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &1956300630
|
--- !u!1 &1956300630
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue