Merge branch 'develop' of bitbucket.org:usaya/popcorn into develop
This commit is contained in:
commit
66c05d5fcb
|
|
@ -1,27 +1,5 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1101 &-917989621425119279
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 7770551281916087710}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 1
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!91 &9100000
|
||||
AnimatorController:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -30,13 +8,7 @@ AnimatorController:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: heart
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters:
|
||||
- m_Name: BigHeart
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
|
|
@ -60,8 +32,7 @@ AnimatorState:
|
|||
m_Name: heart
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: -917989621425119279}
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
|
|
@ -77,31 +48,6 @@ AnimatorState:
|
|||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &6818666326688946123
|
||||
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: BigHeart
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 224529198616294665}
|
||||
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!1107 &7516647177462776758
|
||||
AnimatorStateMachine:
|
||||
serializedVersion: 5
|
||||
|
|
@ -114,12 +60,8 @@ AnimatorStateMachine:
|
|||
- serializedVersion: 1
|
||||
m_State: {fileID: 224529198616294665}
|
||||
m_Position: {x: 270, y: 0, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 7770551281916087710}
|
||||
m_Position: {x: 280, y: 120, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions:
|
||||
- {fileID: 6818666326688946123}
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
m_StateMachineTransitions: {}
|
||||
m_StateMachineBehaviours: []
|
||||
|
|
@ -127,30 +69,4 @@ AnimatorStateMachine:
|
|||
m_EntryPosition: {x: 50, y: 120, z: 0}
|
||||
m_ExitPosition: {x: 800, y: 120, z: 0}
|
||||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||
m_DefaultState: {fileID: 7770551281916087710}
|
||||
--- !u!1102 &7770551281916087710
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Wait
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: 0}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
m_DefaultState: {fileID: 224529198616294665}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,156 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &5409985849651702440
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5409985849651702441}
|
||||
- component: {fileID: 5715829407227760309}
|
||||
- component: {fileID: 1385243083193661112}
|
||||
m_Layer: 0
|
||||
m_Name: Customer
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5409985849651702441
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5409985849651702440}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -1.55, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 5409985851491668856}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &5715829407227760309
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5409985849651702440}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3aa8dec9a88540bf93de4c93663335ec, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
walkSideTopPos: -1.55
|
||||
walkSideBottomPos: -6.5
|
||||
walkSideSpeed: 1.3
|
||||
walkFrontSpeed: 1
|
||||
animator: {fileID: 5409985851491668857}
|
||||
--- !u!114 &1385243083193661112
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5409985849651702440}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 786931d1da2c4b1c8ce9519c9b3c32fd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
animator: {fileID: 0}
|
||||
--- !u!1001 &631677504613307640
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 5409985849651702441}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416728471897999, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: NormalBody
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416729748261544, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4886416730379292500, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: db654393793a67d45a7d0b70a68b73a6, type: 3}
|
||||
--- !u!4 &5409985851491668856 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 631677504613307640}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!95 &5409985851491668857 stripped
|
||||
Animator:
|
||||
m_CorrespondingSourceObject: {fileID: 4886416728471897985, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 631677504613307640}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6fbb038c9aae840f2bea57bce30740f7
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using UniRx;
|
||||
using UniRx.Triggers;
|
||||
using UnityEditor.UIElements;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public enum CustomerMovingType
|
||||
{
|
||||
WalkFront,
|
||||
WalkSide,
|
||||
WalkBack,
|
||||
StayBack,
|
||||
WalkFrontEat,
|
||||
WalkSideEat,
|
||||
}
|
||||
public class CustomerController : MonoBehaviour
|
||||
{
|
||||
private static readonly int WalkFront = Animator.StringToHash("WalkFront");
|
||||
private static readonly int WalkSide = Animator.StringToHash("WalkSide");
|
||||
private static readonly int WalkBack = Animator.StringToHash("WalkBack");
|
||||
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 float leftEndPosision = -10f;
|
||||
// 歩道の幅(min,max)
|
||||
[SerializeField] private float walkSideTopPos = -1.55f;
|
||||
[SerializeField] private float walkSideBottomPos = -6.50f;
|
||||
|
||||
// 歩行速度
|
||||
[SerializeField] private float walkSideSpeed = 1.3f; // 1.3f
|
||||
[SerializeField] private float walkFrontSpeed = 1.0f; // 1.0f
|
||||
private Vector3 speed = Vector3.zero;
|
||||
// 停止時間
|
||||
// 左右どちらから出るか
|
||||
|
||||
[SerializeField] private Animator animator;
|
||||
private void Start()
|
||||
{
|
||||
this.UpdateAsObservable().Subscribe(_ =>
|
||||
{
|
||||
transform.localPosition += speed * Time.deltaTime;
|
||||
}).AddTo(this);
|
||||
}
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
var tmpPos = Vector3.zero;
|
||||
tmpPos.x = leftEndPosision;
|
||||
tmpPos.y = Random.Range(walkSideTopPos, walkSideBottomPos);
|
||||
transform.localPosition = tmpPos;
|
||||
}
|
||||
|
||||
public void SetMove(CustomerMovingType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case CustomerMovingType.WalkFront:
|
||||
animator.SetTrigger(WalkFront);
|
||||
break;
|
||||
case CustomerMovingType.WalkSide:
|
||||
speed = Vector3.right * walkSideSpeed;
|
||||
animator.SetTrigger(WalkSide);
|
||||
break;
|
||||
case CustomerMovingType.WalkBack:
|
||||
animator.SetTrigger(WalkBack);
|
||||
break;
|
||||
case CustomerMovingType.StayBack:
|
||||
speed = Vector3.zero;
|
||||
animator.SetTrigger(StayBack);
|
||||
break;
|
||||
case CustomerMovingType.WalkFrontEat:
|
||||
animator.SetTrigger(WalkFrontEat);
|
||||
break;
|
||||
case CustomerMovingType.WalkSideEat:
|
||||
animator.SetTrigger(WalkSideEat);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(type), type, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCustomerType()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3aa8dec9a88540bf93de4c93663335ec
|
||||
timeCreated: 1629854874
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class HeartAnimation : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject heart;
|
||||
[SerializeField] private Transform target;
|
||||
|
||||
public void GetHeart()
|
||||
{
|
||||
heart.SetActive(true);
|
||||
this.CallWaitForSeconds(.35f, () =>
|
||||
{
|
||||
var cacheTransform = heart.transform;
|
||||
var beginPos = heart.transform.position;
|
||||
cacheTransform.parent = null;
|
||||
this.CallLerp(.5f, f =>
|
||||
{
|
||||
cacheTransform.position = Vector3.Lerp(beginPos, target.position, f.EaseInQuadratic());
|
||||
}, () =>
|
||||
{
|
||||
// 大きいハートアニメーションが再生しきったらハートメーターのレベルが書かれているところに飛んでいき
|
||||
// 小さいハートのアニメーションが再生しきったら「Header」を消すのと同時にメーターが増える
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 786931d1da2c4b1c8ce9519c9b3c32fd
|
||||
timeCreated: 1629863058
|
||||
|
|
@ -12,26 +12,39 @@ public class Market : MonoBehaviour
|
|||
|
||||
[SerializeField] private ShopStockView stockView;
|
||||
[SerializeField] private MarketCartView cartView;
|
||||
[SerializeField] private GameObject customerPrefab;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
var gameData = GameDataManager.GameData;
|
||||
CoinManager.Instance.ChangeCoin(gameData.coin);
|
||||
// 在庫数表示
|
||||
stockView.SetStock(gameData.StorageTanks);
|
||||
|
||||
// 全レシピ
|
||||
var allRecipe = RecipeData.GetAllRecipe();
|
||||
|
||||
// 在庫数表示
|
||||
stockView.SetStock(gameData.StorageTanks);
|
||||
StockFlavorLog();
|
||||
|
||||
// 陳列
|
||||
var displayFlavors = gameData.ShopStock.Select(x => x).ToList();
|
||||
cartView.SetStock(displayFlavors);
|
||||
|
||||
// 売り順決定
|
||||
var shuffledOrder = ShuffleOrder(displayFlavors.Count);
|
||||
|
||||
// お客さん出現パターン確率計算と行動パターン計算
|
||||
Observable.Interval(TimeSpan.FromSeconds(.5f)).Take(5).Subscribe(_ =>
|
||||
{
|
||||
var customer = Instantiate(customerPrefab);
|
||||
var customerController = customer.GetComponent<CustomerController>();
|
||||
customerController.SetMove(CustomerMovingType.WalkSide);
|
||||
customerController.Setup();
|
||||
var heartAnimation = customer.GetComponent<HeartAnimation>();
|
||||
Observable.Timer(TimeSpan.FromSeconds(2f)).Subscribe(__ =>
|
||||
{
|
||||
heartAnimation.GetHeart();
|
||||
});
|
||||
}).AddTo(this);
|
||||
|
||||
|
||||
// お客さんの出現タイミング(10秒間に1回)
|
||||
Observable.Timer(TimeSpan.FromSeconds(2f), TimeSpan.FromSeconds(10f))
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue