自動調理完成時の表示追加

This commit is contained in:
kimura 2022-04-15 13:16:18 +09:00
parent 159ebede22
commit 22252e8711
2 changed files with 182 additions and 3 deletions

View File

@ -1035,11 +1035,20 @@ MonoBehaviour:
m_GameObject: {fileID: 534902212}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7ac380b2956543a6a6b17c6150b154c0, type: 3}
m_Script: {fileID: 11500000, guid: 3417deb36e014d2d85e22d413fc446ab, type: 3}
m_Name:
m_EditorClassIdentifier:
backgroundAnimator: {fileID: 1090969545}
closeButton: {fileID: 0}
closeButton: {fileID: 1530405766}
getButton: {fileID: 406579702}
popcorns:
- {fileID: 1709089885}
- {fileID: 1709089884}
- {fileID: 1709089883}
- {fileID: 1709089882}
- {fileID: 1709089881}
- {fileID: 1709089880}
- {fileID: 1709089879}
--- !u!1 &677856731
GameObject:
m_ObjectHideFlags: 0
@ -2536,16 +2545,66 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 1240257559}
m_Modifications:
- target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 329
objectReference: {fileID: 0}
- target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 329
objectReference: {fileID: 0}
- target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4223190801807453305, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
propertyPath: m_Name
@ -2804,6 +2863,90 @@ RectTransform:
type: 3}
m_PrefabInstance: {fileID: 1709089877}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1709089879 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 413027507554482889, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
m_PrefabInstance: {fileID: 1709089877}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1709089880 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 413027506448404572, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
m_PrefabInstance: {fileID: 1709089877}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1709089881 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 413027506772110985, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
m_PrefabInstance: {fileID: 1709089877}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1709089882 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 413027507580250462, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
m_PrefabInstance: {fileID: 1709089877}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1709089883 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 413027507672086750, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
m_PrefabInstance: {fileID: 1709089877}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1709089884 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 413027506800827693, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
m_PrefabInstance: {fileID: 1709089877}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1709089885 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 413027506015082184, guid: 5f90e42166914c0b83b48c62b7e279e5,
type: 3}
m_PrefabInstance: {fileID: 1709089877}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1808585194
GameObject:
m_ObjectHideFlags: 0

View File

@ -16,7 +16,7 @@ namespace MyGame.Scenes.Main.Scripts
[SerializeField] private Button closeButton;
[SerializeField] private Button getButton;
[SerializeField] private Transform[] popcorns;
[SerializeField] private AutoCookPopcornView[] popcorns;
private void Start()
{
var gameData = GameDataManager.GameData;
@ -36,6 +36,42 @@ namespace MyGame.Scenes.Main.Scripts
}).AddTo(this);
// アイテムのリスト生成
var productList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
var earnProductArray = productList
.Where(data => earnIds.Contains(data.id))
.Select(data => new ProductData(data, 1){volume = Const.TankCapacity})
.ToArray();
var lastProductAmount = autoCookData.earnCount % Const.TankCapacity;
if (lastProductAmount == 0)
{
lastProductAmount = Const.TankCapacity;
}
// リストの最後のポップコーン数を上書き
earnProductArray.Last().volume = lastProductAmount;
for (int i = 0; i < popcorns.Length; i++)
{
if (i < count)
{
popcorns[i].SetView(earnProductArray[i]);
popcorns[i].SetActive(true);
}
else
{
popcorns[i].SetActive(false);
}
}
// 描画計算
var rebuildTarget = popcorns[0].transform.parent.parent;
var originalScale = rebuildTarget.localScale;
rebuildTarget.localScale = Vector3.zero;
Observable.TimerFrame(0, FrameCountType.EndOfFrame).Subscribe(_ =>
{
LayoutRebuilder.ForceRebuildLayoutImmediate(rebuildTarget as RectTransform);
rebuildTarget.localScale = originalScale;
}).AddTo(this);
}
public static void ShowDialog(Action onClose = null){