ResultのPrice表示クラス追加
This commit is contained in:
parent
a76a4242fc
commit
66a41b4151
|
|
@ -130,6 +130,7 @@ GameObject:
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 22866707}
|
- component: {fileID: 22866707}
|
||||||
|
- component: {fileID: 22866708}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: coin
|
m_Name: coin
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -159,6 +160,21 @@ RectTransform:
|
||||||
m_AnchoredPosition: {x: -16, y: -81}
|
m_AnchoredPosition: {x: -16, y: -81}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!114 &22866708
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 22866706}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 4853059b0aca45cc9ad74a1e807e577b, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
coinAnimator: {fileID: 731070674}
|
||||||
|
basePriceText: {fileID: 1015662795}
|
||||||
|
perfectPriceText: {fileID: 1667225192}
|
||||||
--- !u!1 &144061146
|
--- !u!1 &144061146
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
using System;
|
||||||
|
using UniRx;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace MyGame.Scenes.Cooking.Scripts
|
||||||
|
{
|
||||||
|
public class ResultCoinView : MonoBehaviour
|
||||||
|
{
|
||||||
|
private static readonly float startDelay = .5f;
|
||||||
|
private static readonly float interval = 2f;
|
||||||
|
private static readonly int Add = Animator.StringToHash("Add");
|
||||||
|
[SerializeField] private Animator coinAnimator;
|
||||||
|
[SerializeField] private Text basePriceText;
|
||||||
|
[SerializeField] private Text perfectPriceText;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
Observable.Timer(TimeSpan.FromSeconds(startDelay), TimeSpan.FromSeconds(interval)).Subscribe(_ =>
|
||||||
|
{
|
||||||
|
coinAnimator.ResetTrigger(Add);
|
||||||
|
coinAnimator.SetTrigger(Add);
|
||||||
|
}).AddTo(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetPrice(int baseValue, int perfectValue)
|
||||||
|
{
|
||||||
|
basePriceText.text = baseValue.ToString();
|
||||||
|
perfectPriceText.text = perfectValue.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4853059b0aca45cc9ad74a1e807e577b
|
||||||
|
timeCreated: 1637565650
|
||||||
Loading…
Reference in New Issue