Merge branch 'develop' of bitbucket.org:usaya/popcorn into develop
This commit is contained in:
commit
c08ab04fa9
|
|
@ -37,15 +37,18 @@ AnimatorStateMachine:
|
|||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -5937048131293529348}
|
||||
m_Position: {x: 200, y: 0, z: 0}
|
||||
m_Position: {x: 280, y: 10, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -5731495216582312521}
|
||||
m_Position: {x: 235, y: 65, z: 0}
|
||||
m_Position: {x: 320, y: 70, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -7965284502852626432}
|
||||
m_Position: {x: 270, y: 130, z: 0}
|
||||
m_Position: {x: 350, y: 140, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_AnyStateTransitions:
|
||||
- {fileID: 5858741034395082888}
|
||||
- {fileID: 51081042415013300}
|
||||
- {fileID: 4394378192515912696}
|
||||
m_EntryTransitions: []
|
||||
m_StateMachineTransitions: {}
|
||||
m_StateMachineBehaviours: []
|
||||
|
|
@ -114,7 +117,25 @@ AnimatorController:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Brother_pink
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorParameters:
|
||||
- m_Name: Normal
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
- m_Name: Promotion
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
- m_Name: Sleepy
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
|
|
@ -128,3 +149,78 @@ AnimatorController:
|
|||
m_IKPass: 0
|
||||
m_SyncedLayerAffectsTiming: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
--- !u!1101 &51081042415013300
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Promotion
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -5731495216582312521}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &4394378192515912696
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Normal
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -5937048131293529348}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &5858741034395082888
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Sleepy
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -7965284502852626432}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
|
|
|
|||
|
|
@ -14,9 +14,10 @@ AnimatorStateMachine:
|
|||
m_Position: {x: 200, y: 0, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 2605885320556924732}
|
||||
m_Position: {x: 235, y: 65, z: 0}
|
||||
m_Position: {x: 260, y: 110, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_AnyStateTransitions:
|
||||
- {fileID: 7174293807088844408}
|
||||
m_EntryTransitions: []
|
||||
m_StateMachineTransitions: {}
|
||||
m_StateMachineBehaviours: []
|
||||
|
|
@ -33,7 +34,13 @@ AnimatorController:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Customer_order
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorParameters:
|
||||
- m_Name: ComplainTrigger
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
|
|
@ -99,3 +106,28 @@ AnimatorState:
|
|||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &7174293807088844408
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: ComplainTrigger
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 2605885320556924732}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
|
|
|
|||
|
|
@ -133,12 +133,12 @@ AnimationClip:
|
|||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
value: 0
|
||||
inSlope: Infinity
|
||||
outSlope: Infinity
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
inWeight: 0
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
|
|
@ -228,12 +228,12 @@ AnimationClip:
|
|||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 136
|
||||
value: 0
|
||||
inSlope: Infinity
|
||||
outSlope: Infinity
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
inWeight: 0
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ public class DebugOptionManager : MonoBehaviour
|
|||
|
||||
refillLittleProductButton.OnClickAsObservable().Subscribe(_ =>
|
||||
{
|
||||
gameData.StorageTanks.ForEach(x => x.ClearStock());
|
||||
gameData.ShopStock = Enumerable.Repeat(2, 2).ToList();
|
||||
gameData.ShopStock = Enumerable.Repeat(1, 10).ToList();
|
||||
gameData.ShopStock.AddRange(Enumerable.Repeat(2, 10).ToList());
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
animator: {fileID: 5409985851491668857}
|
||||
customerDirection: {fileID: 4855338754077236085}
|
||||
orderAnimator: {fileID: 8184560012277033293}
|
||||
tapReaction: {fileID: 5951905660557715770}
|
||||
orderPopup: {fileID: 5409985850085678672}
|
||||
leftPopcorn: {fileID: 1950136324582499262}
|
||||
rightPopcorn: {fileID: 1950136324150437342}
|
||||
|
|
@ -71,8 +73,6 @@ MonoBehaviour:
|
|||
walkSideLeavePos: -1
|
||||
stopPosision: 0
|
||||
stopPositionRange: 3
|
||||
orderPositions:
|
||||
- {fileID: 0}
|
||||
waitPositions: []
|
||||
orderPosision: 0.5
|
||||
orderPositionRange: 2
|
||||
|
|
@ -140,7 +140,7 @@ PrefabInstance:
|
|||
- target: {fileID: 3340056901353795718, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
|
|
@ -317,9 +317,21 @@ GameObject:
|
|||
type: 3}
|
||||
m_PrefabInstance: {fileID: 631677504613307640}
|
||||
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
|
||||
SpriteRenderer:
|
||||
m_CorrespondingSourceObject: {fileID: 4886416730275037411, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 631677504613307640}
|
||||
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}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class BrotherPinkView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Animator animator;
|
||||
private static readonly int Normal = Animator.StringToHash("Normal");
|
||||
private static readonly int Promotion = Animator.StringToHash("Promotion");
|
||||
private static readonly int Sleepy = Animator.StringToHash("Sleepy");
|
||||
|
||||
public void SetNormal()
|
||||
{
|
||||
animator.SetTrigger(Normal);
|
||||
}
|
||||
|
||||
public void SetPromotion()
|
||||
{
|
||||
animator.SetTrigger(Promotion);
|
||||
}
|
||||
|
||||
public void SetSleepy()
|
||||
{
|
||||
animator.SetTrigger(Sleepy);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6bf6e7fee6cf41a6bad181319bb8b8ed
|
||||
timeCreated: 1631772138
|
||||
|
|
@ -36,10 +36,14 @@ public class CustomerController : MonoBehaviour
|
|||
private static readonly int StayBack = Animator.StringToHash("StayBack");
|
||||
private static readonly int WalkFrontEat = Animator.StringToHash("WalkFrontEat");
|
||||
private static readonly int WalkSideEat = Animator.StringToHash("WalkSideEat");
|
||||
|
||||
|
||||
private static readonly int Complain = Animator.StringToHash("ComplainTrigger");
|
||||
|
||||
[SerializeField] private Animator animator;
|
||||
[SerializeField] private CustomerDirection customerDirection;
|
||||
[SerializeField] private Animator orderAnimator;
|
||||
|
||||
[SerializeField] private GameObject tapReaction;
|
||||
[SerializeField] private GameObject orderPopup;
|
||||
[SerializeField] private SpriteRenderer leftPopcorn;
|
||||
[SerializeField] private SpriteRenderer rightPopcorn;
|
||||
|
|
@ -305,8 +309,23 @@ public class CustomerController : MonoBehaviour
|
|||
orderPopup.SetActive(true);
|
||||
}
|
||||
|
||||
public void ShowComplain()
|
||||
{
|
||||
orderPopup.SetActive(true);
|
||||
orderAnimator.SetTrigger(Complain);
|
||||
this.CallWaitForSeconds(1.5f, () =>
|
||||
{
|
||||
HideOrderPopup();
|
||||
});
|
||||
}
|
||||
|
||||
public void HideOrderPopup()
|
||||
{
|
||||
orderPopup.SetActive(false);
|
||||
}
|
||||
|
||||
public void ShowTapReaction()
|
||||
{
|
||||
tapReaction.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -21,6 +21,8 @@ public class Market : MonoBehaviour
|
|||
[SerializeField] private ShopStockView stockView;
|
||||
[SerializeField] private MarketCartView cartView;
|
||||
[SerializeField] private BrotherBlueView blueView;
|
||||
[SerializeField] private BrotherPinkView pinkView;
|
||||
[SerializeField] private GameObject closeSign;
|
||||
[SerializeField] private GameObject customerPrefab;
|
||||
[SerializeField] private GameObject orderPosisionObject;
|
||||
|
||||
|
|
@ -167,9 +169,14 @@ public class Market : MonoBehaviour
|
|||
// 売り切れ
|
||||
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);
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
// オーダー数
|
||||
|
|
@ -389,9 +396,11 @@ public class Market : MonoBehaviour
|
|||
customerController.ChangeCustomerState(CustomerState.WalkShop);
|
||||
eventTrigger.OnPointerClickAsObservable()
|
||||
.TakeUntil(customerController.MoveEndObservable.Where(type => type == CustomerMovingType.WalkCenter))
|
||||
.TakeWhile(_ => shopState.Value != ShopState.Close)
|
||||
.Take(1)
|
||||
.Subscribe(_ =>
|
||||
{
|
||||
customerController.ShowTapReaction();
|
||||
customerList.Add(customerController);
|
||||
if (customerObject.TryGetComponent(typeof(Collider2D), out var target))
|
||||
{
|
||||
|
|
@ -403,14 +412,56 @@ public class Market : MonoBehaviour
|
|||
{
|
||||
// 歩行者はタップ後customerList.Add()
|
||||
customerController.ChangeCustomerState(CustomerState.Walk);
|
||||
eventTrigger.OnPointerClickAsObservable().Take(1).Subscribe(_ =>
|
||||
{
|
||||
customerList.Add(customerController);
|
||||
if (customerObject.TryGetComponent(typeof(Collider2D), out var target))
|
||||
eventTrigger.OnPointerClickAsObservable()
|
||||
.TakeWhile(_ => shopState.Value != ShopState.Close)
|
||||
.Take(1)
|
||||
.Subscribe(_ =>
|
||||
{
|
||||
Destroy(target);
|
||||
customerController.ShowTapReaction();
|
||||
customerList.Add(customerController);
|
||||
if (customerObject.TryGetComponent(typeof(Collider2D), out var target))
|
||||
{
|
||||
Destroy(target);
|
||||
}
|
||||
}).AddTo(customerController);
|
||||
}
|
||||
}).AddTo(this);
|
||||
|
||||
CompositeDisposable shopStateCompositeDisposable = new CompositeDisposable();
|
||||
shopStateCompositeDisposable.AddTo(this);
|
||||
shopState.Subscribe(state =>
|
||||
{
|
||||
shopStateCompositeDisposable.Clear();
|
||||
switch (state)
|
||||
{
|
||||
case ShopState.Open:
|
||||
pinkView.SetNormal();
|
||||
closeSign.SetActive(false);
|
||||
break;
|
||||
case ShopState.Busy:
|
||||
break;
|
||||
case ShopState.Close:
|
||||
// お客さんが購入中の場合待つ
|
||||
if (customerList.Count(x => x.State.Value == CustomerState.Order) == 0)
|
||||
{
|
||||
pinkView.SetSleepy();
|
||||
closeSign.SetActive(true);
|
||||
}
|
||||
}).AddTo(customerController);
|
||||
else
|
||||
{
|
||||
Observable.CombineLatest(customerList.Select(x => x.State).Where(x => x.Value == CustomerState.Order))
|
||||
.First(states => states.Count(x => x == CustomerState.Order) == 0)
|
||||
.Delay(TimeSpan.FromSeconds(1f))
|
||||
.Subscribe(_ =>
|
||||
{
|
||||
pinkView.SetSleepy();
|
||||
closeSign.SetActive(true);
|
||||
}).AddTo(shopStateCompositeDisposable);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(state), state, null);
|
||||
}
|
||||
}).AddTo(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3074,6 +3074,8 @@ MonoBehaviour:
|
|||
stockView: {fileID: 438315601}
|
||||
cartView: {fileID: 2048621276}
|
||||
blueView: {fileID: 1506158581}
|
||||
pinkView: {fileID: 1749782976}
|
||||
closeSign: {fileID: 1199276394}
|
||||
customerPrefab: {fileID: 5409985849651702440, guid: 6fbb038c9aae840f2bea57bce30740f7,
|
||||
type: 3}
|
||||
orderPosisionObject: {fileID: 384574881}
|
||||
|
|
@ -5170,6 +5172,7 @@ GameObject:
|
|||
m_Component:
|
||||
- component: {fileID: 1749782974}
|
||||
- component: {fileID: 1749782975}
|
||||
- component: {fileID: 1749782976}
|
||||
m_Layer: 0
|
||||
m_Name: Brother_pink
|
||||
m_TagString: Untagged
|
||||
|
|
@ -5214,6 +5217,19 @@ Animator:
|
|||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorControllerStateOnDisable: 0
|
||||
--- !u!114 &1749782976
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1749782973}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6bf6e7fee6cf41a6bad181319bb8b8ed, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
animator: {fileID: 1749782975}
|
||||
--- !u!1001 &1775193988
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue