がっかり演出、タップ演出追加

This commit is contained in:
kimura 2021-09-16 14:46:53 +09:00
parent 240582c7e4
commit fef42b0a59
3 changed files with 55 additions and 13 deletions

View File

@ -58,6 +58,8 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
animator: {fileID: 5409985851491668857} animator: {fileID: 5409985851491668857}
customerDirection: {fileID: 4855338754077236085} customerDirection: {fileID: 4855338754077236085}
orderAnimator: {fileID: 8184560012277033293}
tapReaction: {fileID: 5951905660557715770}
orderPopup: {fileID: 5409985850085678672} orderPopup: {fileID: 5409985850085678672}
leftPopcorn: {fileID: 1950136324582499262} leftPopcorn: {fileID: 1950136324582499262}
rightPopcorn: {fileID: 1950136324150437342} rightPopcorn: {fileID: 1950136324150437342}
@ -71,8 +73,6 @@ MonoBehaviour:
walkSideLeavePos: -1 walkSideLeavePos: -1
stopPosision: 0 stopPosision: 0
stopPositionRange: 3 stopPositionRange: 3
orderPositions:
- {fileID: 0}
waitPositions: [] waitPositions: []
orderPosision: 0.5 orderPosision: 0.5
orderPositionRange: 2 orderPositionRange: 2
@ -140,7 +140,7 @@ PrefabInstance:
- target: {fileID: 3340056901353795718, guid: db654393793a67d45a7d0b70a68b73a6, - target: {fileID: 3340056901353795718, guid: db654393793a67d45a7d0b70a68b73a6,
type: 3} type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6, - target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
type: 3} type: 3}
@ -317,9 +317,21 @@ GameObject:
type: 3} type: 3}
m_PrefabInstance: {fileID: 631677504613307640} m_PrefabInstance: {fileID: 631677504613307640}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!95 &8184560012277033293 stripped
Animator:
m_CorrespondingSourceObject: {fileID: 8741854802242665909, guid: db654393793a67d45a7d0b70a68b73a6,
type: 3}
m_PrefabInstance: {fileID: 631677504613307640}
m_PrefabAsset: {fileID: 0}
--- !u!212 &5409985849570169883 stripped --- !u!212 &5409985849570169883 stripped
SpriteRenderer: SpriteRenderer:
m_CorrespondingSourceObject: {fileID: 4886416730275037411, guid: db654393793a67d45a7d0b70a68b73a6, m_CorrespondingSourceObject: {fileID: 4886416730275037411, guid: db654393793a67d45a7d0b70a68b73a6,
type: 3} type: 3}
m_PrefabInstance: {fileID: 631677504613307640} m_PrefabInstance: {fileID: 631677504613307640}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &5951905660557715770 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6511433195714067906, guid: db654393793a67d45a7d0b70a68b73a6,
type: 3}
m_PrefabInstance: {fileID: 631677504613307640}
m_PrefabAsset: {fileID: 0}

View File

@ -36,10 +36,14 @@ public class CustomerController : MonoBehaviour
private static readonly int StayBack = Animator.StringToHash("StayBack"); private static readonly int StayBack = Animator.StringToHash("StayBack");
private static readonly int WalkFrontEat = Animator.StringToHash("WalkFrontEat"); private static readonly int WalkFrontEat = Animator.StringToHash("WalkFrontEat");
private static readonly int WalkSideEat = Animator.StringToHash("WalkSideEat"); private static readonly int WalkSideEat = Animator.StringToHash("WalkSideEat");
private static readonly int Complain = Animator.StringToHash("ComplainTrigger");
[SerializeField] private Animator animator; [SerializeField] private Animator animator;
[SerializeField] private CustomerDirection customerDirection; [SerializeField] private CustomerDirection customerDirection;
[SerializeField] private Animator orderAnimator;
[SerializeField] private GameObject tapReaction;
[SerializeField] private GameObject orderPopup; [SerializeField] private GameObject orderPopup;
[SerializeField] private SpriteRenderer leftPopcorn; [SerializeField] private SpriteRenderer leftPopcorn;
[SerializeField] private SpriteRenderer rightPopcorn; [SerializeField] private SpriteRenderer rightPopcorn;
@ -305,8 +309,23 @@ public class CustomerController : MonoBehaviour
orderPopup.SetActive(true); orderPopup.SetActive(true);
} }
public void ShowComplain()
{
orderPopup.SetActive(true);
orderAnimator.SetTrigger(Complain);
this.CallWaitForSeconds(1.5f, () =>
{
HideOrderPopup();
});
}
public void HideOrderPopup() public void HideOrderPopup()
{ {
orderPopup.SetActive(false); orderPopup.SetActive(false);
} }
public void ShowTapReaction()
{
tapReaction.SetActive(true);
}
} }

View File

@ -167,9 +167,14 @@ public class Market : MonoBehaviour
// 売り切れ // 売り切れ
if (shuffledOrder.Count == 0) if (shuffledOrder.Count == 0)
{ {
controller.ChangeCustomerState(CustomerState.Leave); controller.ShowWantFlavor(displayFlavors.RandomChoose());
controller.CallWaitForSeconds(1.5f, () =>
{
controller.ShowComplain();
controller.ChangeCustomerState(CustomerState.Leave);
});
dontBuyCustomerList.Add(controller); dontBuyCustomerList.Add(controller);
break; continue;
} }
// オーダー数 // オーダー数
@ -389,9 +394,11 @@ public class Market : MonoBehaviour
customerController.ChangeCustomerState(CustomerState.WalkShop); customerController.ChangeCustomerState(CustomerState.WalkShop);
eventTrigger.OnPointerClickAsObservable() eventTrigger.OnPointerClickAsObservable()
.TakeUntil(customerController.MoveEndObservable.Where(type => type == CustomerMovingType.WalkCenter)) .TakeUntil(customerController.MoveEndObservable.Where(type => type == CustomerMovingType.WalkCenter))
.TakeWhile(_ => shopState.Value != ShopState.Close)
.Take(1) .Take(1)
.Subscribe(_ => .Subscribe(_ =>
{ {
customerController.ShowTapReaction();
customerList.Add(customerController); customerList.Add(customerController);
if (customerObject.TryGetComponent(typeof(Collider2D), out var target)) if (customerObject.TryGetComponent(typeof(Collider2D), out var target))
{ {
@ -403,14 +410,18 @@ public class Market : MonoBehaviour
{ {
// 歩行者はタップ後customerList.Add() // 歩行者はタップ後customerList.Add()
customerController.ChangeCustomerState(CustomerState.Walk); customerController.ChangeCustomerState(CustomerState.Walk);
eventTrigger.OnPointerClickAsObservable().Take(1).Subscribe(_ => eventTrigger.OnPointerClickAsObservable()
{ .TakeWhile(_ => shopState.Value != ShopState.Close)
customerList.Add(customerController); .Take(1)
if (customerObject.TryGetComponent(typeof(Collider2D), out var target)) .Subscribe(_ =>
{ {
Destroy(target); customerController.ShowTapReaction();
} customerList.Add(customerController);
}).AddTo(customerController); if (customerObject.TryGetComponent(typeof(Collider2D), out var target))
{
Destroy(target);
}
}).AddTo(customerController);
} }
}).AddTo(this); }).AddTo(this);
} }