Add Alot of stuff, Computer, repairStation, Whole game, Many things!
This commit is contained in:
@@ -1,5 +1,139 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3096247509938969863
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2579693046821952761}
|
||||
- component: {fileID: 8028199953353550877}
|
||||
- component: {fileID: 4734145443259180329}
|
||||
m_Layer: 5
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2579693046821952761
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3096247509938969863}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3973078567107739988}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 200, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8028199953353550877
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3096247509938969863}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &4734145443259180329
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3096247509938969863}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: New Text
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 36
|
||||
m_fontSizeBase: 36
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &3582750950399662834
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -9,6 +143,9 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6564429125302780662}
|
||||
- component: {fileID: 2626769806097928812}
|
||||
- component: {fileID: 323721399381893304}
|
||||
- component: {fileID: 7484184910861808735}
|
||||
m_Layer: 0
|
||||
m_Name: Customer
|
||||
m_TagString: Untagged
|
||||
@@ -29,16 +166,379 @@ Transform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 4680687846769661018}
|
||||
- {fileID: 4013785496967212353}
|
||||
- {fileID: 8019979993914469277}
|
||||
- {fileID: 2353741547831399736}
|
||||
- {fileID: 3973078567107739988}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &2626769806097928812
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3582750950399662834}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b50833c62b5f59644a29221ccb3ffb18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_minWaitTime: 5
|
||||
_maxWaitTime: 10
|
||||
_buyChance: 0.3
|
||||
_buyChanceIncrease: 0.2
|
||||
_buyChanceDecrease: 0.3
|
||||
_objectHolder: {fileID: 2353741547831399736}
|
||||
--- !u!195 &323721399381893304
|
||||
NavMeshAgent:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3582750950399662834}
|
||||
m_Enabled: 1
|
||||
m_AgentTypeID: 0
|
||||
m_Radius: 0.4
|
||||
m_Speed: 3.5
|
||||
m_Acceleration: 8
|
||||
avoidancePriority: 50
|
||||
m_AngularSpeed: 120
|
||||
m_StoppingDistance: 0
|
||||
m_AutoTraverseOffMeshLink: 1
|
||||
m_AutoBraking: 1
|
||||
m_AutoRepath: 1
|
||||
m_Height: 2
|
||||
m_BaseOffset: 0
|
||||
m_WalkableMask: 4294967295
|
||||
m_ObstacleAvoidanceType: 4
|
||||
--- !u!114 &7484184910861808735
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3582750950399662834}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 165e0ca2b8b0b3a40b36b5b46e91dca9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_customerNomal: {fileID: 6838593136780136478}
|
||||
_customerAngry: {fileID: 6763356380254657486}
|
||||
--- !u!1 &3951142034581684682
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2353741547831399736}
|
||||
m_Layer: 0
|
||||
m_Name: ItemHandle
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2353741547831399736
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3951142034581684682}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1.831, z: 0.5}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6564429125302780662}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &6763356380254657486
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8019979993914469277}
|
||||
m_Layer: 0
|
||||
m_Name: Angry
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8019979993914469277
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6763356380254657486}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2334956513988168255}
|
||||
m_Father: {fileID: 6564429125302780662}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &6796302241985326907
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3973078567107739988}
|
||||
- component: {fileID: 5021036160212185713}
|
||||
- component: {fileID: 6049552928424139037}
|
||||
- component: {fileID: 1392404261179993453}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3973078567107739988
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6796302241985326907}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2579693046821952761}
|
||||
m_Father: {fileID: 6564429125302780662}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 960, y: 540}
|
||||
m_SizeDelta: {x: 10, y: 10}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!223 &5021036160212185713
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6796302241985326907}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &6049552928424139037
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6796302241985326907}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &1392404261179993453
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6796302241985326907}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!1 &6838593136780136478
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4013785496967212353}
|
||||
m_Layer: 0
|
||||
m_Name: Normal
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4013785496967212353
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6838593136780136478}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 4680687846769661018}
|
||||
m_Father: {fileID: 6564429125302780662}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &2877193134574579156
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8019979993914469277}
|
||||
m_Modifications:
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0.49999988
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0.49999988
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0.50000024
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0.5000001
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 90
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 90
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_ConstrainProportionsScale
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -1684107799473140416, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_Materials.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 1aa713fc36ad6ad409f0167b1bd7e2ca, type: 2}
|
||||
- target: {fileID: 919132149155446097, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Customer (1)
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6317578925029434746, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_Materials.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 1aa713fc36ad6ad409f0167b1bd7e2ca, type: 2}
|
||||
- target: {fileID: 8100320773420232829, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
propertyPath: m_Materials.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 1aa713fc36ad6ad409f0167b1bd7e2ca, type: 2}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: b89594669d2f8c447924e07361919e00, type: 3}
|
||||
--- !u!4 &2334956513988168255 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 2877193134574579156}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &5152009883973645233
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 6564429125302780662}
|
||||
m_TransformParent: {fileID: 4013785496967212353}
|
||||
m_Modifications:
|
||||
- target: {fileID: -8679921383154817045, guid: b89594669d2f8c447924e07361919e00,
|
||||
type: 3}
|
||||
|
||||
133
Assets/Customer/CustomerAngry.mat
Normal file
133
Assets/Customer/CustomerAngry.mat
Normal file
@@ -0,0 +1,133 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-3385930777553547782
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 7
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: CustomerAngry
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 0
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 0
|
||||
- _Metallic: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.005
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.78867924, g: 0.08184399, b: 0.08184399, a: 1}
|
||||
- _Color: {r: 0.78867924, g: 0.08184395, b: 0.08184395, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
8
Assets/Customer/CustomerAngry.mat.meta
Normal file
8
Assets/Customer/CustomerAngry.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1aa713fc36ad6ad409f0167b1bd7e2ca
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,18 +1,206 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using Customer;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
using static Customer.MoodState;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public class CustomerController : MonoBehaviour, IObjectParentHolder {
|
||||
private NavMeshAgent _navMeshAgent;
|
||||
private Vector3 _target;
|
||||
|
||||
public SellCounter TargetCounter { get; private set; }
|
||||
|
||||
[Header("WaitTime")] [SerializeField] private float _minWaitTime = 5.0f;
|
||||
[SerializeField] private float _maxWaitTime = 10.0f;
|
||||
|
||||
[Header("BuyChace")] [SerializeField] private float _buyChance = 0.5f;
|
||||
[SerializeField] private float _buyChanceIncrease = 0.1f;
|
||||
[SerializeField] private float _buyChanceDecrease = 0.1f;
|
||||
|
||||
|
||||
[SerializeField] private Transform _objectHolder;
|
||||
|
||||
private Object _currentObject;
|
||||
|
||||
private float _waitTime;
|
||||
|
||||
private CustomerVisibleController _visibleController;
|
||||
|
||||
public MoodState State => _visibleController.GetState();
|
||||
|
||||
private Vector3 _exitPosition;
|
||||
public event Action<SellCounter, CustomerController> OnCustomerLeft;
|
||||
|
||||
|
||||
private CustomerState _state = CustomerState.GoingToCounter;
|
||||
|
||||
//enum
|
||||
public enum CustomerState {
|
||||
GoingToCounter,
|
||||
WaitingToBuy,
|
||||
Buying,
|
||||
WalkingToExit
|
||||
}
|
||||
|
||||
public class CustomerController : MonoBehaviour {
|
||||
NavMeshAgent _navMeshAgent;
|
||||
private Transform _target;
|
||||
|
||||
private void Awake() {
|
||||
_navMeshAgent = GetComponent<NavMeshAgent>();
|
||||
_visibleController = GetComponent<CustomerVisibleController>();
|
||||
|
||||
_visibleController.SetState(Normal);
|
||||
}
|
||||
|
||||
|
||||
private void Update() {
|
||||
_target = PlayerController.Instance.transform;
|
||||
_navMeshAgent.SetDestination(_target.position);
|
||||
switch (_state) {
|
||||
case CustomerState.GoingToCounter:
|
||||
if (_navMeshAgent.remainingDistance <= _navMeshAgent.stoppingDistance) {
|
||||
OnDestinationReached();
|
||||
}
|
||||
|
||||
break;
|
||||
case CustomerState.WaitingToBuy:
|
||||
WaitToBuy();
|
||||
break;
|
||||
case CustomerState.Buying:
|
||||
BuyItem();
|
||||
break;
|
||||
case CustomerState.WalkingToExit:
|
||||
CheckIfReachedExit();
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckIfReachedExit() {
|
||||
if (_navMeshAgent.remainingDistance <= _navMeshAgent.stoppingDistance) {
|
||||
Debug.Log("Bye :p");
|
||||
CustomerManager.Instance.CustomerDies(this);
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private bool ShouldBuyItem() {
|
||||
//This should be a function that checks if a customer should buy an item
|
||||
//For example, if the item is worth 10 bucks, and the player sets the price to 20, the customer should not buy it since its too expensive
|
||||
|
||||
//if an item is prices higher then X% of the base price, the customer should not buy it
|
||||
Object obj = TargetCounter.GetObject();
|
||||
if (obj == null) {
|
||||
Debug.LogError("Counter has no object");
|
||||
return false;
|
||||
}
|
||||
|
||||
float price = obj.ObjectSo.basePrice;
|
||||
float sellPrice = TargetCounter.GetSellingPrice();
|
||||
bool isBroken = obj.IsBroken;
|
||||
|
||||
float difference = Mathf.Abs(price - sellPrice);
|
||||
float percentage = difference / price;
|
||||
|
||||
//Log this for now
|
||||
Debug.Log("Difference: " + difference + " Percentage: " + percentage);
|
||||
//Random differnece between 0.1 and 0.2;
|
||||
float diff = Random.Range(_buyChanceDecrease, _buyChanceIncrease);
|
||||
|
||||
var calculatedBuyChance = _buyChance;
|
||||
|
||||
if (isBroken) {
|
||||
//Customer should be less likely to buy broken items
|
||||
calculatedBuyChance -= 0.1f;
|
||||
}
|
||||
|
||||
if (percentage > calculatedBuyChance + diff) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SetDestination(Vector3 position) {
|
||||
_target = position;
|
||||
_navMeshAgent.SetDestination(_target);
|
||||
}
|
||||
|
||||
public void SetTargetCounter(SellCounter counter) {
|
||||
TargetCounter = counter;
|
||||
|
||||
float angle = Random.Range(0, 360);
|
||||
Vector3 offset = new Vector3(Mathf.Cos(angle), 0, Mathf.Sin(angle));
|
||||
this.SetDestination(counter.transform.position + offset);
|
||||
}
|
||||
|
||||
private void BuyItem() {
|
||||
if (TargetCounter == null) {
|
||||
Debug.LogError("Customer has no target counter");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ShouldBuyItem()) {
|
||||
Debug.Log("Customer should not buy item");
|
||||
this.SetDestination(_exitPosition);
|
||||
_state = CustomerState.WalkingToExit;
|
||||
_visibleController.SetState(Angry);
|
||||
SoundFXController.Instance.PlayVillagerAngryFX();
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("Customer bought item: " + TargetCounter.GetObject().ObjectSo.objectName + " for: " +
|
||||
TargetCounter.GetSellingPrice());
|
||||
_visibleController.SetState(Normal);
|
||||
TargetCounter.SellItem(this);
|
||||
SoundFXController.Instance.PlayItemBoughtFX();
|
||||
SoundFXController.Instance.PlayVillagerHappyFX();
|
||||
this.SetDestination(_exitPosition);
|
||||
_state = CustomerState.WalkingToExit;
|
||||
OnCustomerLeft?.Invoke(TargetCounter, this); //Notify the customer manager that the customer left
|
||||
}
|
||||
|
||||
private void OnDestinationReached() {
|
||||
//should tell the counter there is a customer waiting;
|
||||
Debug.Log("Customer reached destination for Counter: " + TargetCounter.name);
|
||||
_state = CustomerState.WaitingToBuy;
|
||||
_waitTime = Random.Range(_minWaitTime, _maxWaitTime);
|
||||
}
|
||||
|
||||
void OnDrawGizmosSelected() {
|
||||
Gizmos.color = Color.red;
|
||||
Gizmos.DrawWireSphere(_target, 0.5f);
|
||||
}
|
||||
|
||||
void WaitToBuy() {
|
||||
_waitTime -= Time.deltaTime;
|
||||
if (_waitTime <= 0) {
|
||||
_state = CustomerState.Buying;
|
||||
}
|
||||
}
|
||||
|
||||
public Transform GetHolderTransform() {
|
||||
return _objectHolder;
|
||||
}
|
||||
|
||||
public void SetObject(Object obj) {
|
||||
_currentObject = obj;
|
||||
}
|
||||
|
||||
public Object GetObject() {
|
||||
return _currentObject;
|
||||
}
|
||||
|
||||
public void ClearObject() {
|
||||
_currentObject = null;
|
||||
}
|
||||
|
||||
public bool HasObject() {
|
||||
return _currentObject != null;
|
||||
}
|
||||
|
||||
public void SetExitPosition(Vector3 position) {
|
||||
_exitPosition = position;
|
||||
}
|
||||
|
||||
|
||||
public void SetState(CustomerState state) {
|
||||
_state = state;
|
||||
}
|
||||
}
|
||||
133
Assets/Customer/CustomerHappy.mat
Normal file
133
Assets/Customer/CustomerHappy.mat
Normal file
@@ -0,0 +1,133 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-3385930777553547782
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 7
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: CustomerHappy
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 0
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 0
|
||||
- _Metallic: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.005
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
8
Assets/Customer/CustomerHappy.mat.meta
Normal file
8
Assets/Customer/CustomerHappy.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80f72f7a775ddda49827bbbee4cde94a
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
124
Assets/Customer/CustomerManager.cs
Normal file
124
Assets/Customer/CustomerManager.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
using UnityEngine;
|
||||
using static CustomerController;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
|
||||
public class CustomerManager : MonoBehaviour {
|
||||
public static CustomerManager Instance { get; private set; }
|
||||
|
||||
|
||||
[SerializeField] private GameObject _customerPrefab;
|
||||
[SerializeField] private Transform _customerSpawnPoint;
|
||||
|
||||
[SerializeField] private float _timeToNextCustomerMin = 5;
|
||||
[SerializeField] private float _timeToNextCustomerMax = 10;
|
||||
|
||||
private List<SellCounter> _sellCounters = new List<SellCounter>();
|
||||
private List<SellCounter> AvailableCounters { get; } = new List<SellCounter>();
|
||||
|
||||
private readonly List<CustomerController> _customers = new List<CustomerController>();
|
||||
|
||||
private int _newCustomerNeeded; // 0 = no new ones needed, > 0 = new one needed
|
||||
private float _timeToNextCustomer;
|
||||
|
||||
|
||||
//Args for the event
|
||||
public class OnCustomerLeftArgs : EventArgs {
|
||||
public bool Angry;
|
||||
}
|
||||
|
||||
public event EventHandler<OnCustomerLeftArgs> OnCustomerLeft;
|
||||
|
||||
// Start is called before the first frame update
|
||||
private void Start() {
|
||||
// Find all sellingCounters in the scene
|
||||
|
||||
if (Instance != null) {
|
||||
Debug.LogError("What? 2 CustomerManagers crazy!!!");
|
||||
}
|
||||
|
||||
Instance = this;
|
||||
|
||||
var sellCounters = FindObjectsOfType<SellCounter>();
|
||||
foreach (var sellCounter in sellCounters) {
|
||||
sellCounter.OnCounterStartSelling += CounterStartedSelling;
|
||||
_sellCounters?.Add(sellCounter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void CounterStartedSelling(object sender, [NotNull] SellCounter.OnCounterStartSellingArgs e) {
|
||||
if (e == null) throw new ArgumentNullException(nameof(e));
|
||||
// Spawn a customer at the spawn point
|
||||
_newCustomerNeeded += 1;
|
||||
AvailableCounters.Add(e.SellCounter);
|
||||
}
|
||||
|
||||
private void SpawnCustomer(SellCounter target) {
|
||||
var customer = Instantiate(_customerPrefab, _customerSpawnPoint.position, Quaternion.identity);
|
||||
var customerController = customer.GetComponent<CustomerController>();
|
||||
|
||||
customerController.SetTargetCounter(target);
|
||||
customerController.SetExitPosition(_customerSpawnPoint.position);
|
||||
|
||||
customerController.OnCustomerLeft += CustomerLeft;
|
||||
_customers.Add(customerController);
|
||||
}
|
||||
|
||||
private void CustomerLeft(SellCounter sellCounter, CustomerController customerController) {
|
||||
if (customerController.State == Customer.MoodState.Angry) {
|
||||
//Customer left angry, should dispach a new customer to the counter
|
||||
_newCustomerNeeded += 1;
|
||||
if (!AvailableCounters.Contains(sellCounter)) {
|
||||
AvailableCounters.Add(sellCounter);
|
||||
}
|
||||
else {
|
||||
Debug.LogError("This should not happen, the counter is already in the available list");
|
||||
}
|
||||
}
|
||||
OnCustomerLeft?.Invoke(this, new OnCustomerLeftArgs { Angry = customerController.State == Customer.MoodState.Angry });
|
||||
}
|
||||
|
||||
|
||||
// Update is called once per frame
|
||||
private void Update() {
|
||||
if(AvailableCounters.Count == 0) return;
|
||||
if (_newCustomerNeeded > 0) {
|
||||
_timeToNextCustomer -= Time.deltaTime;
|
||||
if (_timeToNextCustomer <= 0) {
|
||||
_newCustomerNeeded--;
|
||||
_timeToNextCustomer = Random.Range(_timeToNextCustomerMin, _timeToNextCustomerMax);
|
||||
|
||||
SellCounter target = AvailableCounters[Random.Range(0, AvailableCounters.Count)];
|
||||
SpawnCustomer(target);
|
||||
|
||||
AvailableCounters.Remove(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void StoppedSelling(SellCounter sellCounter) {
|
||||
if (AvailableCounters.Contains(sellCounter)) {
|
||||
AvailableCounters.Remove(sellCounter);
|
||||
}
|
||||
|
||||
//Check if any customer has this counter as an target
|
||||
foreach (var customerController in _customers) {
|
||||
if (customerController.TargetCounter != sellCounter) continue;
|
||||
|
||||
customerController.SetDestination(_customerSpawnPoint.position);
|
||||
customerController.SetState(CustomerState.WalkingToExit);
|
||||
}
|
||||
}
|
||||
|
||||
public void CustomerDies([NotNull] CustomerController customerController) {
|
||||
if (customerController == null) return;
|
||||
if (_customers.Contains(customerController)) {
|
||||
_customers.Remove(customerController);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Customer/CustomerManager.cs.meta
Normal file
11
Assets/Customer/CustomerManager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12673c52136a26945ac08bbacf744c08
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
42
Assets/Customer/CustomerVisibleController.cs
Normal file
42
Assets/Customer/CustomerVisibleController.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Customer {
|
||||
public enum MoodState {
|
||||
Normal,
|
||||
Angry
|
||||
}
|
||||
|
||||
public class CustomerVisibleController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject _customerNomal;
|
||||
[SerializeField] private GameObject _customerAngry;
|
||||
|
||||
private MoodState _state = MoodState.Normal;
|
||||
|
||||
private void SetNormal() {
|
||||
_customerNomal.SetActive(true);
|
||||
_customerAngry.SetActive(false);
|
||||
}
|
||||
|
||||
private void SetAngry() {
|
||||
_customerNomal.SetActive(false);
|
||||
_customerAngry.SetActive(true);
|
||||
}
|
||||
|
||||
public void SetState(MoodState state) {
|
||||
_state = state;
|
||||
switch (_state) {
|
||||
case MoodState.Normal:
|
||||
SetNormal();
|
||||
break;
|
||||
case MoodState.Angry:
|
||||
SetAngry();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public MoodState GetState() {
|
||||
return _state;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Customer/CustomerVisibleController.cs.meta
Normal file
11
Assets/Customer/CustomerVisibleController.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 165e0ca2b8b0b3a40b36b5b46e91dca9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user