キッチンのバイトアニメーション対応
This commit is contained in:
parent
0c286fd8c8
commit
3212ae212d
|
@ -178,7 +178,7 @@ AnimatorState:
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: customer_Employment_stay_front
|
m_Name: customer_Employment_stay_front_Flyer
|
||||||
m_Speed: 1
|
m_Speed: 1
|
||||||
m_CycleOffset: 0
|
m_CycleOffset: 0
|
||||||
m_Transitions: []
|
m_Transitions: []
|
||||||
|
@ -516,7 +516,7 @@ AnimatorState:
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: customer_Employment_stay_front 0
|
m_Name: customer_Employment_stay_front
|
||||||
m_Speed: 1
|
m_Speed: 1
|
||||||
m_CycleOffset: 0
|
m_CycleOffset: 0
|
||||||
m_Transitions: []
|
m_Transitions: []
|
||||||
|
|
|
@ -5398,6 +5398,12 @@ SpriteRenderer:
|
||||||
m_WasSpriteAssigned: 1
|
m_WasSpriteAssigned: 1
|
||||||
m_MaskInteraction: 0
|
m_MaskInteraction: 0
|
||||||
m_SpriteSortPoint: 0
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!95 &1555295522 stripped
|
||||||
|
Animator:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 3318268871473007409, guid: 00e0cbb85389d424f9f75bbd5db123a8,
|
||||||
|
type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 460559075}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1 &1592053832
|
--- !u!1 &1592053832
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -6467,7 +6473,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!4 &1823553375
|
--- !u!4 &1823553375
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -6814,6 +6820,7 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
blueBrotherAnimator: {fileID: 1124341218}
|
blueBrotherAnimator: {fileID: 1124341218}
|
||||||
pinkBrotherAnimator: {fileID: 519190656}
|
pinkBrotherAnimator: {fileID: 519190656}
|
||||||
|
partTimerAnimator: {fileID: 1555295522}
|
||||||
pinkTransform: {fileID: 519190655}
|
pinkTransform: {fileID: 519190655}
|
||||||
pinkWalkSpeed: 0.8
|
pinkWalkSpeed: 0.8
|
||||||
pinkLivelySpeed: 1
|
pinkLivelySpeed: 1
|
||||||
|
@ -8130,7 +8137,7 @@ PrefabInstance:
|
||||||
- target: {fileID: 1408184404978035950, guid: caaa748dbeed576499e8cae74d33f689,
|
- target: {fileID: 1408184404978035950, guid: caaa748dbeed576499e8cae74d33f689,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_RootOrder
|
propertyPath: m_RootOrder
|
||||||
value: 9
|
value: 10
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1750965193008879782, guid: caaa748dbeed576499e8cae74d33f689,
|
- target: {fileID: 1750965193008879782, guid: caaa748dbeed576499e8cae74d33f689,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class KitchenManager : MonoBehaviour
|
||||||
* バイト表示
|
* バイト表示
|
||||||
* バイト開放の条件は最新店舗ではない都市(最新店舗以外はバイトが居る)
|
* バイト開放の条件は最新店舗ではない都市(最新店舗以外はバイトが居る)
|
||||||
*/
|
*/
|
||||||
var isPartTimer = !GameDataUtils.CheckLatestCity(globalGameData.CurrentCityId);
|
var isPartTimer = GameDataUtils.IsPartTimerCurrentCity();
|
||||||
if (isPartTimer)
|
if (isPartTimer)
|
||||||
{
|
{
|
||||||
var partTimersData = SpreadsheetDataManager.Instance.GetBaseDataList<PartTimerData>(Const.PartTimerDataSheet);
|
var partTimersData = SpreadsheetDataManager.Instance.GetBaseDataList<PartTimerData>(Const.PartTimerDataSheet);
|
||||||
|
@ -282,7 +282,7 @@ public class KitchenManager : MonoBehaviour
|
||||||
SoundManager.Instance.StopSE("se_Main_phone_sound");
|
SoundManager.Instance.StopSE("se_Main_phone_sound");
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
||||||
kitchenView.Initialize();
|
kitchenView.Initialize(isPartTimer);
|
||||||
adButton.OnClickAsObservable()
|
adButton.OnClickAsObservable()
|
||||||
.Merge(showAdDialogSubject)
|
.Merge(showAdDialogSubject)
|
||||||
.ThrottleFirst(TimeSpan.FromSeconds(.3f)).Subscribe(_ =>
|
.ThrottleFirst(TimeSpan.FromSeconds(.3f)).Subscribe(_ =>
|
||||||
|
|
|
@ -16,6 +16,7 @@ public class KitchenView : MonoBehaviour
|
||||||
private static readonly int Vitality = Animator.StringToHash("Vitality");
|
private static readonly int Vitality = Animator.StringToHash("Vitality");
|
||||||
[SerializeField] private Animator blueBrotherAnimator;
|
[SerializeField] private Animator blueBrotherAnimator;
|
||||||
[SerializeField] private Animator pinkBrotherAnimator;
|
[SerializeField] private Animator pinkBrotherAnimator;
|
||||||
|
[SerializeField] private Animator partTimerAnimator;
|
||||||
[SerializeField] private Transform pinkTransform;
|
[SerializeField] private Transform pinkTransform;
|
||||||
[SerializeField] private float pinkWalkSpeed = .8f;
|
[SerializeField] private float pinkWalkSpeed = .8f;
|
||||||
[SerializeField] private float pinkLivelySpeed = .8f;
|
[SerializeField] private float pinkLivelySpeed = .8f;
|
||||||
|
@ -43,10 +44,11 @@ public class KitchenView : MonoBehaviour
|
||||||
private float completedDuration;
|
private float completedDuration;
|
||||||
private bool isLively;
|
private bool isLively;
|
||||||
private (int trigger, Vector2 wayPoint, float wait)[] selectedMoves;
|
private (int trigger, Vector2 wayPoint, float wait)[] selectedMoves;
|
||||||
|
private bool partTimerActive;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
this.UpdateAsObservable().Subscribe(_ =>
|
this.UpdateAsObservable().Where(_ => !partTimerActive).Subscribe(_ =>
|
||||||
{
|
{
|
||||||
var pinkSpeed = isLively ? pinkLivelySpeed : pinkWalkSpeed;
|
var pinkSpeed = isLively ? pinkLivelySpeed : pinkWalkSpeed;
|
||||||
var localPosition = pinkTransform.localPosition;
|
var localPosition = pinkTransform.localPosition;
|
||||||
|
@ -70,9 +72,15 @@ public class KitchenView : MonoBehaviour
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize(bool isPartTimer)
|
||||||
{
|
{
|
||||||
moveIndex = 0;
|
moveIndex = 0;
|
||||||
|
partTimerActive = isPartTimer;
|
||||||
|
SetActive(true);
|
||||||
|
if (isPartTimer)
|
||||||
|
{
|
||||||
|
partTimerAnimator.Play("customer_Employment_stay_front");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChangeAnimation()
|
private void ChangeAnimation()
|
||||||
|
@ -117,6 +125,12 @@ public class KitchenView : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetActive(bool active)
|
public void SetActive(bool active)
|
||||||
|
{
|
||||||
|
partTimerAnimator.transform.SetLocalScale(partTimerActive && active ? 1f : 0f);
|
||||||
|
SetBrotherActive(!partTimerActive && active);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetBrotherActive(bool active)
|
||||||
{
|
{
|
||||||
blueBrotherAnimator.transform.SetLocalScale(active ? 1f : 0f);
|
blueBrotherAnimator.transform.SetLocalScale(active ? 1f : 0f);
|
||||||
pinkBrotherAnimator.transform.SetLocalScale(active ? 1f : 0f);
|
pinkBrotherAnimator.transform.SetLocalScale(active ? 1f : 0f);
|
||||||
|
|
|
@ -4,6 +4,11 @@ namespace MyGame.Scripts
|
||||||
{
|
{
|
||||||
public static class GameDataUtils
|
public static class GameDataUtils
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 指定した都市が開放されてから兄弟が働いて獲得したハートの数
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cityId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static int GetPartTimerHeart(int cityId)
|
public static int GetPartTimerHeart(int cityId)
|
||||||
{
|
{
|
||||||
var cityDataList = GameDataManager.GameData.CityGameDataDict.Values;
|
var cityDataList = GameDataManager.GameData.CityGameDataDict.Values;
|
||||||
|
@ -57,5 +62,7 @@ namespace MyGame.Scripts
|
||||||
dict.Add(cityId, newCityData);
|
dict.Add(cityId, newCityData);
|
||||||
return dict[cityId];
|
return dict[cityId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsPartTimerCurrentCity() => !CheckLatestCity(GameDataManager.GameData.CurrentCityId);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue