お客さん重なり改善
This commit is contained in:
parent
e90dc76f5d
commit
4ffad111ed
|
|
@ -52,12 +52,14 @@ MonoBehaviour:
|
||||||
wantFlavorSprite: {fileID: 5409985849570169883}
|
wantFlavorSprite: {fileID: 5409985849570169883}
|
||||||
defaultSprite: {fileID: 21300000, guid: 99d426990eeb08d4d85ae03f04609196, type: 3}
|
defaultSprite: {fileID: 21300000, guid: 99d426990eeb08d4d85ae03f04609196, type: 3}
|
||||||
caramelSprite: {fileID: 21300000, guid: 469b78432f101024aa1a2060a57231d8, type: 3}
|
caramelSprite: {fileID: 21300000, guid: 469b78432f101024aa1a2060a57231d8, type: 3}
|
||||||
walkSideTopPos: -1.55
|
walkSideTopPosition: -0.6
|
||||||
walkSideBottomPos: -6.5
|
walkSideMidPos: -4
|
||||||
|
walkSideBottomPos: -6.7
|
||||||
stopPosision: 0
|
stopPosision: 0
|
||||||
stopPositionRange: 1
|
stopPositionRange: 1
|
||||||
orderStayPositions: []
|
orderStayPositions: []
|
||||||
orderPosision: 0.5
|
orderPosision: 0.5
|
||||||
|
orderPositionRange: 2
|
||||||
waitOrderPosision: -0.6
|
waitOrderPosision: -0.6
|
||||||
walkSideSpeed: 1.3
|
walkSideSpeed: 1.3
|
||||||
walkFrontBackSpeed: 1
|
walkFrontBackSpeed: 1
|
||||||
|
|
@ -76,6 +78,17 @@ MonoBehaviour:
|
||||||
bigHeart: {fileID: 7988005957398545984}
|
bigHeart: {fileID: 7988005957398545984}
|
||||||
smallHeart: {fileID: 992423202615605163}
|
smallHeart: {fileID: 992423202615605163}
|
||||||
target: {fileID: 0}
|
target: {fileID: 0}
|
||||||
|
--- !u!210 &7449452199590198578
|
||||||
|
SortingGroup:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5409985851491668855}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 23
|
||||||
--- !u!1001 &631677504613307640
|
--- !u!1001 &631677504613307640
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -165,6 +178,12 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: db654393793a67d45a7d0b70a68b73a6, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: db654393793a67d45a7d0b70a68b73a6, type: 3}
|
||||||
|
--- !u!1 &5409985851491668855 stripped
|
||||||
|
GameObject:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 4886416728471897999, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||||
|
type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 631677504613307640}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!4 &5409985851491668856 stripped
|
--- !u!4 &5409985851491668856 stripped
|
||||||
Transform:
|
Transform:
|
||||||
m_CorrespondingSourceObject: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
m_CorrespondingSourceObject: {fileID: 4886416728471897984, guid: db654393793a67d45a7d0b70a68b73a6,
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,9 @@ public class CustomerController : MonoBehaviour
|
||||||
[SerializeField] private Sprite caramelSprite;
|
[SerializeField] private Sprite caramelSprite;
|
||||||
|
|
||||||
// 歩道の幅(min,max)
|
// 歩道の幅(min,max)
|
||||||
[SerializeField] private float walkSideTopPos = -1.55f;
|
[SerializeField] private float walkSideTopPosition;
|
||||||
[SerializeField] private float walkSideBottomPos = -6.50f;
|
[SerializeField] private float walkSideMidPos;
|
||||||
|
[SerializeField] private float walkSideBottomPos;
|
||||||
// 立ち止まる範囲
|
// 立ち止まる範囲
|
||||||
[SerializeField] private float stopPosision = 0f;
|
[SerializeField] private float stopPosision = 0f;
|
||||||
[SerializeField] private float stopPositionRange = 2f;
|
[SerializeField] private float stopPositionRange = 2f;
|
||||||
|
|
@ -46,6 +47,7 @@ public class CustomerController : MonoBehaviour
|
||||||
[SerializeField] private List<Transform> orderStayPositions = new List<Transform>();
|
[SerializeField] private List<Transform> orderStayPositions = new List<Transform>();
|
||||||
// 購入ポジ
|
// 購入ポジ
|
||||||
[SerializeField] private float orderPosision = .5f;
|
[SerializeField] private float orderPosision = .5f;
|
||||||
|
[SerializeField] private float orderPositionRange = 2f;
|
||||||
[SerializeField] private float waitOrderPosision = .2f;
|
[SerializeField] private float waitOrderPosision = .2f;
|
||||||
// 歩行速度
|
// 歩行速度
|
||||||
[SerializeField] private float walkSideSpeed = 1.3f; // 1.3f
|
[SerializeField] private float walkSideSpeed = 1.3f; // 1.3f
|
||||||
|
|
@ -80,9 +82,10 @@ public class CustomerController : MonoBehaviour
|
||||||
{
|
{
|
||||||
beginPos = Vector3.zero;
|
beginPos = Vector3.zero;
|
||||||
beginPos.x = leftEndPosision;
|
beginPos.x = leftEndPosision;
|
||||||
beginPos.y = Random.Range(walkSideTopPos, walkSideBottomPos);
|
beginPos.y = Random.Range(walkSideMidPos, walkSideBottomPos);
|
||||||
|
beginPos.z = beginPos.y + Mathf.Abs(walkSideBottomPos);
|
||||||
transform.localPosition = beginPos;
|
transform.localPosition = beginPos;
|
||||||
wayPoint = beginPos;
|
SetWayPoint(beginPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddMove(CustomerMovingType type)
|
public void AddMove(CustomerMovingType type)
|
||||||
|
|
@ -90,27 +93,28 @@ public class CustomerController : MonoBehaviour
|
||||||
moves.Add(type);
|
moves.Add(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// キャラの奥行き描画順のため、y方向に対応したz軸を設定
|
||||||
private void SetMove(CustomerMovingType type)
|
private void SetMove(CustomerMovingType type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case CustomerMovingType.WalkFront:
|
case CustomerMovingType.WalkFront:
|
||||||
wayPoint = Vector3.zero + Vector3.up * beginPos.y;
|
SetWayPoint(new Vector3(wayPoint.x, Random.Range(walkSideMidPos, walkSideTopPosition)));
|
||||||
speed = walkFrontBackSpeed;
|
speed = walkFrontBackSpeed;
|
||||||
animator.SetTrigger(WalkFront);
|
animator.SetTrigger(WalkFront);
|
||||||
break;
|
break;
|
||||||
case CustomerMovingType.WalkSide:
|
case CustomerMovingType.WalkSide:
|
||||||
wayPoint = beginPos + Vector3.right * -leftEndPosision * 2;
|
SetWayPoint(new Vector3(-leftEndPosision, wayPoint.y));
|
||||||
speed = walkSideSpeed;
|
speed = walkSideSpeed;
|
||||||
animator.SetTrigger(WalkSide);
|
animator.SetTrigger(WalkSide);
|
||||||
break;
|
break;
|
||||||
case CustomerMovingType.WalkBack:
|
case CustomerMovingType.WalkBack:
|
||||||
wayPoint = Vector3.zero + Vector3.up * orderPosision;
|
SetWayPoint(new Vector3((Random.value - .5f) * 2 * orderPositionRange, orderPosision));
|
||||||
speed = walkFrontBackSpeed;
|
speed = walkFrontBackSpeed;
|
||||||
animator.SetTrigger(WalkBack);
|
animator.SetTrigger(WalkBack);
|
||||||
break;
|
break;
|
||||||
case CustomerMovingType.WalkBackHalf:
|
case CustomerMovingType.WalkBackHalf:
|
||||||
wayPoint = new Vector3(stopPosision + (Random.value - .5f) * 2 * stopPositionRange, waitOrderPosision);
|
SetWayPoint(new Vector3(stopPosision + (Random.value - .5f) * 2 * stopPositionRange, waitOrderPosision));
|
||||||
speed = walkFrontBackSpeed;
|
speed = walkFrontBackSpeed;
|
||||||
animator.SetTrigger(WalkBack);
|
animator.SetTrigger(WalkBack);
|
||||||
break;
|
break;
|
||||||
|
|
@ -124,17 +128,17 @@ public class CustomerController : MonoBehaviour
|
||||||
animator.SetTrigger(StayBackLook);
|
animator.SetTrigger(StayBackLook);
|
||||||
break;
|
break;
|
||||||
case CustomerMovingType.WalkFrontEat:
|
case CustomerMovingType.WalkFrontEat:
|
||||||
wayPoint = Vector3.zero + Vector3.up * beginPos.y;
|
SetWayPoint(new Vector3(wayPoint.x, Random.Range(walkSideMidPos, walkSideTopPosition)));
|
||||||
speed = walkFrontBackSpeed;
|
speed = walkFrontBackSpeed;
|
||||||
animator.SetTrigger(WalkFrontEat);
|
animator.SetTrigger(WalkFrontEat);
|
||||||
break;
|
break;
|
||||||
case CustomerMovingType.WalkSideEat:
|
case CustomerMovingType.WalkSideEat:
|
||||||
wayPoint = beginPos + Vector3.right * -leftEndPosision * 2;
|
SetWayPoint(new Vector3(-leftEndPosision, wayPoint.y));
|
||||||
speed = walkSideSpeed;
|
speed = walkSideSpeed;
|
||||||
animator.SetTrigger(WalkSideEat);
|
animator.SetTrigger(WalkSideEat);
|
||||||
break;
|
break;
|
||||||
case CustomerMovingType.WalkCenter:
|
case CustomerMovingType.WalkCenter:
|
||||||
wayPoint = new Vector3(stopPosision + (Random.value - .5f) * 2 * stopPositionRange, beginPos.y);
|
SetWayPoint(new Vector3(stopPosision + (Random.value - .5f) * 2 * stopPositionRange, beginPos.y));
|
||||||
speed = walkSideSpeed;
|
speed = walkSideSpeed;
|
||||||
animator.SetTrigger(WalkSide);
|
animator.SetTrigger(WalkSide);
|
||||||
break;
|
break;
|
||||||
|
|
@ -143,6 +147,12 @@ public class CustomerController : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetWayPoint(Vector3 point)
|
||||||
|
{
|
||||||
|
wayPoint = point;
|
||||||
|
wayPoint.z = wayPoint.y + Mathf.Abs(walkSideBottomPos);
|
||||||
|
}
|
||||||
|
|
||||||
public void ChangeWantFlavor(int flavor)
|
public void ChangeWantFlavor(int flavor)
|
||||||
{
|
{
|
||||||
if (flavor == 2)
|
if (flavor == 2)
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ public class Market : MonoBehaviour
|
||||||
});
|
});
|
||||||
customerController.AddMove(CustomerMovingType.WalkFrontEat);
|
customerController.AddMove(CustomerMovingType.WalkFrontEat);
|
||||||
customerController.AddMove(CustomerMovingType.WalkSideEat);
|
customerController.AddMove(CustomerMovingType.WalkSideEat);
|
||||||
|
Destroy(customer.gameObject, 10f);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue