1
0
Fork 0

Merge branch 'master' into Sound

This commit is contained in:
Unknown 2018-04-23 14:09:02 +02:00
commit c126d80e2d
51 changed files with 1650 additions and 414 deletions

1
.gitignore vendored
View file

@ -80,6 +80,7 @@ Temporary Items
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db.meta
ehthumbs.db
ehthumbs_vista.db

View file

@ -0,0 +1,148 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1379543051791382}
m_IsPrefabParent: 1
--- !u!1 &1379543051791382
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4781595464190240}
- component: {fileID: 212185122411066660}
- component: {fileID: 114075590146335024}
- component: {fileID: 61667207399653724}
- component: {fileID: 50031891945467640}
m_Layer: 0
m_Name: Bullet
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4781595464190240
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1379543051791382}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -0.625, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!50 &50031891945467640
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1379543051791382}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 1
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!61 &61667207399653724
BoxCollider2D:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1379543051791382}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.0035692453, y: 0.022604823}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 1, y: 1}
newSize: {x: 10, y: 10}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 0.12197816, y: 0.23143363}
m_EdgeRadius: 0
--- !u!114 &114075590146335024
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1379543051791382}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cfff064e4589e34cb5b415dcc016dc1, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: 10
damage: 0
--- !u!212 &212185122411066660
SpriteRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1379543051791382}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: f0a1f29b04961544d939bb5bd18e56c2, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 10, y: 10}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0

View file

@ -1,7 +1,8 @@
fileFormatVersion: 2
guid: 2d31ccee7cee6da4dbcc5cad2f0f7552
DefaultImporter:
guid: c6c321ecc6516374781405a54c1fa6a7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -11,6 +11,21 @@ Prefab:
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1679161327080020}
m_IsPrefabParent: 1
--- !u!1 &1136532900431144
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4676354101874032}
m_Layer: 8
m_Name: BulletSpawn
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1281416296700930
GameObject:
m_ObjectHideFlags: 0
@ -19,7 +34,7 @@ GameObject:
serializedVersion: 5
m_Component:
- component: {fileID: 4830909199357604}
m_Layer: 0
m_Layer: 8
m_Name: Graphics
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -38,7 +53,7 @@ GameObject:
- component: {fileID: 114874769993434856}
- component: {fileID: 114835806183609276}
- component: {fileID: 60772848946696534}
m_Layer: 0
m_Layer: 8
m_Name: Player
m_TagString: Player
m_Icon: {fileID: 0}
@ -54,7 +69,7 @@ GameObject:
m_Component:
- component: {fileID: 4564951497896744}
- component: {fileID: 212241819326847048}
m_Layer: 0
m_Layer: 8
m_Name: vehicleTMP
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -71,7 +86,7 @@ GameObject:
- component: {fileID: 4240907079511616}
- component: {fileID: 198696209911726984}
- component: {fileID: 199437974736988364}
m_Layer: 0
m_Layer: 8
m_Name: Particle System
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -89,6 +104,7 @@ Transform:
m_LocalScale: {x: 0.25, y: 0.25, z: 0.25}
m_Children:
- {fileID: 4830909199357604}
- {fileID: 4676354101874032}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -118,6 +134,19 @@ Transform:
m_Father: {fileID: 4830909199357604}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4676354101874032
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1136532900431144}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.23, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4079161515917916}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4830909199357604
Transform:
m_ObjectHideFlags: 1
@ -146,7 +175,7 @@ Rigidbody2D:
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0
m_AngularDrag: 1.1
m_GravityScale: 0
m_Material: {fileID: 0}
m_Interpolate: 1
@ -207,6 +236,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4a1319c82afce6e47b9ec0980f156e39, type: 3}
m_Name:
m_EditorClassIdentifier:
bulletPrefab: {fileID: 1379543051791382, guid: c6c321ecc6516374781405a54c1fa6a7,
type: 2}
bulletSpawn: {fileID: 4676354101874032}
carDamage: 5
--- !u!114 &114874769993434856
MonoBehaviour:
m_ObjectHideFlags: 1

View file

@ -0,0 +1,179 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1303102899095328}
m_IsPrefabParent: 1
--- !u!1 &1303102899095328
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4612758478389004}
- component: {fileID: 61708904748430096}
- component: {fileID: 50733723059255246}
- component: {fileID: 114448442531622302}
m_Layer: 9
m_Name: Scorpion
m_TagString: Enemy
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1513538628701824
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4615957218218632}
- component: {fileID: 212910646889249274}
m_Layer: 9
m_Name: Graphics
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4612758478389004
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1303102899095328}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 7.6580257, y: 3.506653, z: -0.08491792}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4615957218218632}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4615957218218632
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1513538628701824}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children: []
m_Father: {fileID: 4612758478389004}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!50 &50733723059255246
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1303102899095328}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0.1
m_AngularDrag: 0.05
m_GravityScale: 0
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!61 &61708904748430096
BoxCollider2D:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1303102899095328}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.009958029, y: 0.009958148}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0}
oldSize: {x: 0, y: 0}
newSize: {x: 0, y: 0}
adaptiveTilingThreshold: 0
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 0.82075834, y: 1.3385675}
m_EdgeRadius: 0
--- !u!114 &114448442531622302
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1303102899095328}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0d221474512c53044b3507bc53b9c7a8, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: 1
rotationSpeed: 1
victim: {fileID: 0}
body: {fileID: 50733723059255246}
--- !u!212 &212910646889249274
SpriteRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1513538628701824}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 15f3203a08153fd45b58ca15caed3ac9, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.441, y: 0.69}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4c5ecfd27b4038941a6e493a8117ea0a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -108,7 +108,7 @@ GameObject:
- component: {fileID: 222889581033239706}
- component: {fileID: 114750232192698844}
m_Layer: 5
m_Name: GameOverPanel
m_Name: RestartPanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -760,8 +760,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
notifications: {fileID: 114700265308343224}
gameOverPanel: {fileID: 1604998495297016}
restartUIPanel: {fileID: 1604998495297016}
healthcontroller: {fileID: 114617351635937986}
mainMenuSceneIndex: 0
--- !u!114 &114930219842054174
MonoBehaviour:
m_ObjectHideFlags: 1
@ -1013,13 +1014,13 @@ RectTransform:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1505922857439362}
m_LocalRotation: {x: -0, y: -0, z: 0.08715578, w: 0.9961947}
m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.49999988, y: 0.49999988, z: 1}
m_Children: []
m_Father: {fileID: 224833383346886274}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 10}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -7.3055115, y: -3.7793121}

View file

@ -170,7 +170,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 816024605}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &368878861
AudioSource:
@ -448,9 +448,9 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1908750962}
- {fileID: 368878860}
- {fileID: 1028937043}
- {fileID: 1908750962}
m_Father: {fileID: 734498092}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -497,6 +497,17 @@ Prefab:
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114835806183609276, guid: 3d1911457c1e44f53b6b4044334db52f,
type: 2}
propertyPath: bulletSpawn
value:
objectReference: {fileID: 2032758561}
- target: {fileID: 114835806183609276, guid: 3d1911457c1e44f53b6b4044334db52f,
type: 2}
propertyPath: bulletPrefab
value:
objectReference: {fileID: 1379543051791382, guid: c6c321ecc6516374781405a54c1fa6a7,
type: 2}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2}
m_IsPrefabParent: 0
@ -512,6 +523,7 @@ GameObject:
- component: {fileID: 881384369}
- component: {fileID: 881384368}
- component: {fileID: 881384372}
- component: {fileID: 881384373}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
@ -553,7 +565,7 @@ Camera:
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 10
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
@ -595,6 +607,25 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
followThis: {fileID: 0}
--- !u!114 &881384373
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 881384367}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e40ea81463f7264a8ce9334d6bf62ac, type: 3}
m_Name:
m_EditorClassIdentifier:
mixer: {fileID: 24100000, guid: efb934a745665924d8c7dd46c0a117ae, type: 2}
maintheme: {fileID: 24500006, guid: efb934a745665924d8c7dd46c0a117ae, type: 2}
end: {fileID: 245089854461186482, guid: efb934a745665924d8c7dd46c0a117ae, type: 2}
gameovers: {fileID: 801288609}
soundeffects:
- {fileID: 1908750963}
- {fileID: 368878861}
- {fileID: 801288609}
--- !u!1 &1028937042
GameObject:
m_ObjectHideFlags: 0
@ -622,7 +653,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 816024605}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &1028937044
AudioSource:
@ -727,11 +758,6 @@ Prefab:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 224011665836974194, guid: 460d856ea4eb14cedb5fecde1fe6d743,
type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 224011665836974194, guid: 460d856ea4eb14cedb5fecde1fe6d743,
type: 2}
propertyPath: m_LocalPosition.x
@ -825,7 +851,7 @@ Prefab:
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
type: 2}
propertyPath: m_AnchoredPosition.x
value: 65.33481
value: 66.396866
objectReference: {fileID: 0}
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
type: 2}
@ -857,6 +883,15 @@ Prefab:
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1604998495297016, guid: 460d856ea4eb14cedb5fecde1fe6d743, type: 2}
propertyPath: m_Name
value: RestartPanel
objectReference: {fileID: 0}
- target: {fileID: 114917026543374048, guid: 460d856ea4eb14cedb5fecde1fe6d743,
type: 2}
propertyPath: restartUIPanel
value:
objectReference: {fileID: 1755791938}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 460d856ea4eb14cedb5fecde1fe6d743, type: 2}
m_IsPrefabParent: 0
@ -865,6 +900,48 @@ GameObject:
m_PrefabParentObject: {fileID: 1998375241450644, guid: 460d856ea4eb14cedb5fecde1fe6d743,
type: 2}
m_PrefabInternal: {fileID: 1379476068}
--- !u!1001 &1597985551
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2}
propertyPath: m_LocalPosition.x
value: 7.6580257
objectReference: {fileID: 0}
- target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2}
propertyPath: m_LocalPosition.y
value: 3.506653
objectReference: {fileID: 0}
- target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2}
propertyPath: m_LocalPosition.z
value: -0.08491792
objectReference: {fileID: 0}
- target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1600556433
GameObject:
m_ObjectHideFlags: 0
@ -1017,6 +1094,11 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1755791938 stripped
GameObject:
m_PrefabParentObject: {fileID: 1604998495297016, guid: 460d856ea4eb14cedb5fecde1fe6d743,
type: 2}
m_PrefabInternal: {fileID: 1379476068}
--- !u!1 &1908750961
GameObject:
m_ObjectHideFlags: 0
@ -1044,7 +1126,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 816024605}
m_RootOrder: 0
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &1908750963
AudioSource:
@ -1142,6 +1224,11 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!4 &2032758561 stripped
Transform:
m_PrefabParentObject: {fileID: 4676354101874032, guid: 3d1911457c1e44f53b6b4044334db52f,
type: 2}
m_PrefabInternal: {fileID: 865504979}
--- !u!1 &2063368131
GameObject:
m_ObjectHideFlags: 0

View file

@ -452,7 +452,8 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 863866091}
- {fileID: 1263994058}
- {fileID: 1100252403}
- {fileID: 2026061257}
- {fileID: 1321930645}
m_Father: {fileID: 1622722979}
@ -475,18 +476,18 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0, b: 0.22017574, a: 0.392}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_Sprite: {fileID: 0}
m_Type: 3
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillMethod: 1
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
@ -526,80 +527,6 @@ Transform:
m_Father: {fileID: 1926562125}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &863866090
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 863866091}
- component: {fileID: 863866093}
- component: {fileID: 863866092}
m_Layer: 5
m_Name: Dungeon Drifter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &863866091
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 863866090}
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_Children: []
m_Father: {fileID: 626823871}
m_RootOrder: 0
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: 122}
m_SizeDelta: {x: 800, y: 200}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &863866092
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 863866090}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 100
m_FontStyle: 1
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 100
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Dungeon Drifter
--- !u!222 &863866093
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 863866090}
--- !u!1 &923869161
GameObject:
m_ObjectHideFlags: 0
@ -973,7 +900,7 @@ RectTransform:
m_GameObject: {fileID: 1039057777}
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_LocalScale: {x: 0.4, y: 0.4, z: 1}
m_Children: []
m_Father: {fileID: 1321930645}
m_RootOrder: 0
@ -995,7 +922,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -1004,16 +931,16 @@ MonoBehaviour:
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 24
m_FontSize: 100
m_FontStyle: 1
m_BestFit: 0
m_BestFit: 1
m_MinSize: 2
m_MaxSize: 40
m_MaxSize: 200
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: Exit
--- !u!222 &1039057780
@ -1022,6 +949,74 @@ CanvasRenderer:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1039057777}
--- !u!1 &1100252402
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1100252403}
- component: {fileID: 1100252405}
- component: {fileID: 1100252404}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1100252403
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1100252402}
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_Children: []
m_Father: {fileID: 626823871}
m_RootOrder: 1
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: 24, y: 44}
m_SizeDelta: {x: 611.8, y: 611.8}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1100252404
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1100252402}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: a5b609314fdfae040aabe4e6601291df, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!222 &1100252405
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1100252402}
--- !u!1 &1187801171
GameObject:
m_ObjectHideFlags: 0
@ -1147,6 +1142,74 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1 &1263994057
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1263994058}
- component: {fileID: 1263994060}
- component: {fileID: 1263994059}
m_Layer: 5
m_Name: BG
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1263994058
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1263994057}
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_Children: []
m_Father: {fileID: 626823871}
m_RootOrder: 0
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.1, y: -38.1}
m_SizeDelta: {x: 1184.1, y: 1184.1}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1263994059
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1263994057}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 79d2e82f1d7398f41aa2dd6501e9d21c, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!222 &1263994060
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1263994057}
--- !u!1 &1321930644
GameObject:
m_ObjectHideFlags: 0
@ -1179,11 +1242,11 @@ RectTransform:
m_Children:
- {fileID: 1039057778}
m_Father: {fileID: 626823871}
m_RootOrder: 2
m_RootOrder: 3
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: -170}
m_AnchoredPosition: {x: 255, y: -190}
m_SizeDelta: {x: 250, y: 60}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1321930646
@ -1206,11 +1269,11 @@ MonoBehaviour:
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_HighlightedColor: {r: 0.5943396, g: 0.08118772, b: 0.058873262, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_FadeDuration: 0.15
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
@ -1299,6 +1362,7 @@ MonoBehaviour:
notifications: {fileID: 0}
gameOverPanel: {fileID: 0}
healthcontroller: {fileID: 0}
mainMenuSceneIndex: 0
--- !u!1 &1586619316
GameObject:
m_ObjectHideFlags: 0
@ -1325,7 +1389,7 @@ RectTransform:
m_GameObject: {fileID: 1586619316}
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_LocalScale: {x: 0.4, y: 0.4, z: 1}
m_Children: []
m_Father: {fileID: 2026061257}
m_RootOrder: 0
@ -1341,7 +1405,7 @@ MonoBehaviour:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1586619316}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 1573420865, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
@ -1361,7 +1425,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -1370,16 +1434,16 @@ MonoBehaviour:
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 24
m_FontSize: 100
m_FontStyle: 1
m_BestFit: 0
m_BestFit: 1
m_MinSize: 2
m_MaxSize: 40
m_MaxSize: 200
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: Play
--- !u!222 &1586619320
@ -1575,11 +1639,11 @@ RectTransform:
m_Children:
- {fileID: 1586619317}
m_Father: {fileID: 626823871}
m_RootOrder: 1
m_RootOrder: 2
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: -56}
m_AnchoredPosition: {x: -263, y: -190}
m_SizeDelta: {x: 250, y: 60}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2026061258
@ -1602,7 +1666,7 @@ MonoBehaviour:
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_HighlightedColor: {r: 0.027450982, g: 0.5019608, b: 0.074938804, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
@ -1695,3 +1759,4 @@ MonoBehaviour:
notifications: {fileID: 0}
gameOverPanel: {fileID: 0}
healthcontroller: {fileID: 0}
mainMenuSceneIndex: 0

45
Assets/Scripts/Bullet.cs Normal file
View file

@ -0,0 +1,45 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Bullet : MonoBehaviour {
[SerializeField]
protected float speed = 1;
[SerializeField]
int damage = 0;
GameObject owner;
// Use this for initialization
void Start () {
}
public void SetDamage(int dmg) {
damage = dmg;
}
public void SetOwner(GameObject ow) {
owner = ow;
}
// Update is called once per frame
void Update () {
if ( owner == null )
return;
transform.position = transform.position + transform.localRotation * Vector3.up * speed * Time.deltaTime; // TODO do with physics (rigidbody)
}
void OnCollisionEnter2D(Collision2D collision) {
if ( owner == null )
return;
if ( collision.collider.gameObject.tag != owner.tag ) {
Mob m = collision.collider.gameObject.GetComponent(typeof(Mob)) as Mob;
if (m != null) {
m.InflictDamage(damage);
}
Destroy(this.gameObject);
}
}
}

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 582bfd99a32c0ea45a7d09ef4f308d88
guid: 0cfff064e4589e34cb5b415dcc016dc1
MonoImporter:
externalObjects: {}
serializedVersion: 2

View file

@ -18,7 +18,7 @@ public class CameraControl : MonoBehaviour {
void LateUpdate() {
if ( followThis == null )
return;
var target = followThis.transform.position + offset;
var target = followThis.transform.position; // + offset;
var targetVec = target - transform.position;
targetVec.Scale(new Vector3(0.05f, 0.05f, 0));

View file

@ -10,7 +10,7 @@ public class Door : MonoBehaviour {
BoxCollider2D triggerBox;
// Use this for initialization
void Start() {
void Awake() {
BoxCollider2D[] colliders = GetComponents<BoxCollider2D>();
foreach ( BoxCollider2D collider in colliders ) {
if ( collider.isTrigger ) {
@ -21,7 +21,6 @@ public class Door : MonoBehaviour {
//Debug.Log("Found Door collider");
}
}
Unlock();
}
/// <summary>

View file

@ -1,46 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyAI : MonoBehaviour {
private GameObject victim;
Rigidbody2D body;
[SerializeField]
private float speed = 1;
[SerializeField]
private float rotationSpeed = 1;
/*
* Die destructive dumme deutsche Dungeon Diktator Drifter DLC Debakel Distribution Dokumentations - Druck Datei
*/
// Use this for initialization
void Start () {
victim = null;
body = gameObject.GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update ()
{
if(victim == null) {
//victim = GameController.instance.GetPlayer().gameObject; // TODO testing purpose only!
return;
}
Vector3 distanceToEnemy = victim.transform.position - gameObject.transform.position;
// movement
body.velocity = new Vector2(distanceToEnemy.normalized.x, distanceToEnemy.normalized.y) * speed;
//rotation
Vector3 localRotation = gameObject.transform.localRotation * Vector3.up;
float angleToRotate = Mathf.Round(Vector3.SignedAngle(localRotation, distanceToEnemy.normalized, Vector3.forward));
gameObject.transform.Rotate(0, 0, angleToRotate * rotationSpeed);
}
public void SetVictim(GameObject g) {
victim = g;
}
}

View file

@ -1,5 +1,6 @@
fileFormatVersion: 2
guid: 8fb7fb6f1af73414788fa9d286e4c6dc
guid: ad806e075b6034b4c9ceb3ae832ac6a3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:

View file

@ -0,0 +1,7 @@
namespace Assets.Scripts.Entities.Attack {
public interface IAttack {
void Attack();
float GetRange();
float GetCooldownTime();
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 58fd06520c77b6e4683cbf37114a3062
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Assets.Scripts.Entities.Attack {
[Serializable]
class MeleeAttack : IAttack {
int damage = 10;
float cooldown = 1;
float range = 2f;
GameObject owner;
public MeleeAttack(GameObject owner) {
this.owner = owner;
}
public void Attack() {
RaycastHit2D[] hits = Physics2D.RaycastAll(owner.transform.position, owner.transform.localRotation * Vector3.up, range);
List<RaycastHit2D> rh = new List<RaycastHit2D>(hits);
RaycastHit2D hit = rh.Find(x => x.fraction != 0);
Mob m = null;
if (hit.collider != null && hit.collider.gameObject != null) {
m = hit.collider.gameObject.GetComponent(typeof(Mob)) as Mob;
}
Debug.Log(m.tag);
if ( m != null && m.tag != owner.tag) {
m.InflictDamage(damage);
}
// Todo animation?
}
public float GetCooldownTime() {
return cooldown;
}
public float GetRange() {
return range;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6320d45b19b0dac4d829864e5cc9e6d9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Assets.Scripts.Entities.Attack {
class SingleShot : IAttack {
int damage = 12;
float cooldown = 1;
int range = 4;
GameObject owner;
GameObject bulletPrefab;
Transform spawn;
public SingleShot(GameObject owner) {
this.owner = owner;
}
public void SetSpawn(Transform t) {
spawn = t;
}
public void SetPrefab(GameObject bullet) {
this.bulletPrefab = bullet;
}
public void Attack() {
if ( bulletPrefab == null )
return;
GameObject b = GameObject.Instantiate(bulletPrefab);
b.transform.rotation = spawn.rotation;
b.transform.position = spawn.position;
Bullet bu = b.GetComponent<Bullet>();
bu.SetDamage(damage);
bu.SetOwner(owner);
GameController.instance.GetAudioControl().SfxPlay(0);
}
public float GetCooldownTime() {
return cooldown;
}
public float GetRange() {
return range;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 49a9496d02160ac448645af09ce8540f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using Assets.Scripts.Entities.Attack;
namespace Assets.Scripts.Entities {
class Enemy : Mob {
[SerializeField]
private float speed = 1;
[SerializeField]
private float rotationSpeed = 1;
[SerializeField]
protected GameObject victim;
[SerializeField]
private Rigidbody2D body;
private float nextAttackTime;
public Enemy(int mHP) : base(mHP) {
}
void Update() {
if ( victim == null || attack == null ) {
return;
}
if ( Time.timeSinceLevelLoad >= nextAttackTime ) {
RaycastHit2D[] hits = Physics2D.RaycastAll(transform.position, transform.localRotation * Vector3.up, attack.GetRange());
List<RaycastHit2D> rh = new List<RaycastHit2D>(hits);
RaycastHit2D hit = rh.Find(x => x.fraction != 0);
if ( hit.collider != null && hit.collider.gameObject == victim ) {
Debug.Log("Attacking Player!!!");
attack.Attack();
nextAttackTime = Time.timeSinceLevelLoad + attack.GetCooldownTime();
}
}
Vector3 distanceToEnemy = victim.transform.position - gameObject.transform.position;
//rotation
Vector3 localRotation = gameObject.transform.localRotation * Vector3.up;
float angleToRotate = Mathf.Round(Vector3.SignedAngle(localRotation, distanceToEnemy.normalized, Vector3.forward));
gameObject.transform.Rotate(0, 0, angleToRotate * rotationSpeed);
if ( distanceToEnemy.magnitude < attack.GetRange() ) {
return;
}
// movement
body.velocity = new Vector2(distanceToEnemy.normalized.x, distanceToEnemy.normalized.y) * speed;
}
public void SetVictim(GameObject g) {
victim = g;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3b0dd37750beb51419e397f295f9b925
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,8 +1,11 @@
public abstract class Mob : Entity {
readonly int maxHP;
int currentHP;
bool isDead;
int damage;
using Assets.Scripts.Entities.Attack;
using UnityEngine;
public abstract class Mob : Entity {
protected readonly int maxHP;
protected int currentHP;
protected bool isDead;
protected IAttack attack;
/// <summary>
/// Creates a new Mob instance with the given HP.
@ -14,11 +17,16 @@
isDead = false;
}
public void SetAttack(IAttack attack) {
this.attack = attack;
}
/// <summary>
/// Inflicts damage to this mob.
/// </summary>
/// <param name="damage"></param>
public void InflictDamage(int damage) {
Debug.Log(tag + " received " + damage + " Damage");
currentHP -= damage;
if ( !isDead && currentHP <= 0 ) {
isDead = true;
@ -44,22 +52,6 @@
currentHP = ( currentHP + healAmount > currentHP ) ? maxHP : currentHP + healAmount;
}
/// <summary>
/// Sets the damage value of a mobs attack.
/// </summary>
/// <param name="dmg"></param>
public void SetDamage(int dmg) {
damage = dmg;
}
/// <summary>
/// Gets the damage value og a mobs attack.
/// </summary>
/// <returns></returns>
public int GetDamage() {
return damage;
}
/// <summary>
/// Gets the current HP.
/// </summary>

View file

@ -1,11 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using Assets.Scripts.Entities.Attack;
using UnityEngine;
public class Player : Mob {
[SerializeField]
private GameObject bulletPrefab;
[SerializeField]
Transform bulletSpawn;
[SerializeField]
private int carDamage = 5;
private float nextAttackTime;
public Player() : base(100) { }
private void Start() {
SingleShot s = new SingleShot(this.gameObject);
s.SetPrefab(bulletPrefab);
s.SetSpawn(bulletSpawn);
SetAttack(s);
}
void Update() {
if ( Time.timeSinceLevelLoad >= nextAttackTime && attack != null) {
if ( Input.GetKey(KeyCode.Space) ) {
Debug.Log("Attack pressed!");
attack.Attack();
nextAttackTime = Time.timeSinceLevelLoad + attack.GetCooldownTime();
}
}
}
/// <summary>
/// Collision checking. Player is going to die on any collision with a wall.
/// </summary>
@ -14,12 +40,12 @@ public class Player : Mob {
Debug.Log("Collision");
if ( collision.collider.tag == "wall" ) {
Death();
} else if ( collision.collider.tag == "enemy" ) {
} else if ( collision.collider.tag == "Enemy" ) {
Mob m = collision.collider.GetComponent(typeof(Mob)) as Mob;
if ( m != null ) {
InflictDamage(m.GetDamage()); // TODO think about Mob attac mechanic
//m.InflictDamage(carDamage);
//InflictDamage(carDamage); // TODO
}
}
}

View file

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using Assets.Scripts.Entities.Attack;
namespace Assets.Scripts.Entities {
class Scorpion : Enemy {
public Scorpion() : base(30) {
}
private void Start() {
SetAttack(new MeleeAttack(this.gameObject));
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0d221474512c53044b3507bc53b9c7a8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -107,7 +107,6 @@ public class GameController : MonoBehaviour {
genPrefabs.Add(GenerationProcessor.ExtendedTileType.RockLRD, RockLRD);
genPrefabs.Add(GenerationProcessor.ExtendedTileType.Ground, Ground);
genPrefabs.Add(GenerationProcessor.ExtendedTileType.Door, Door);
}
// Update is called once per frame
@ -177,7 +176,7 @@ public class GameController : MonoBehaviour {
spawnpointRoot.transform.position = new Vector3(dg.start.roomPosition.x, dg.start.roomPosition.y, 0);
GameObject spawn = new GameObject();
spawn.transform.SetParent(spawnpointRoot.transform);
spawn.transform.position = new Vector3(3, 3, 0);
spawn.transform.position = new Vector3(dg.start.GetCenter().x, dg.start.GetCenter().y, 0);
start.SetSpawnPointsRootObject(spawnpointRoot);
start.Reload();
@ -226,6 +225,7 @@ public class GameController : MonoBehaviour {
player = goal.GetPlayer();
if ( player != null ) {
cam.GetComponent<CameraControl>().SetFollow(player.gameObject);
GetUI().InitHealthController(player);
} else {
Debug.Log("No Player spawned!");
}
@ -240,14 +240,22 @@ public class GameController : MonoBehaviour {
//Time.timeScale = 0;
if ( ui != null ) {
Debug.Log("show Gameover UI");
cam.GetComponent<AudioControl>().SfxPlay(2);
ui.GetComponent<UIController>().ShowGameOverUI();
} else {
Debug.Log("No UI specified");
}
}
public AudioControl GetAudioControl() {
return cam.GetComponent<AudioControl>();
}
public UIController GetUI() {
return ui.GetComponent<UIController>();
}
public bool GameEnded() {
return state == GameState.ENDED;
}
}

View file

@ -17,9 +17,6 @@ public class DungeonGenerator {
// All rooms except the three above
public HashSet<GenRoom> rooms;
private const float percentageRocks = 0.03f;
private const int maxRockCluster = 5;
public void Generate() {
int minRoomSize = 50;
rooms = new HashSet<GenRoom>();
@ -127,11 +124,13 @@ public class DungeonGenerator {
foreach ( GenRoom r in rooms ) {
for ( int x1 = r.bounds.x; x1 < r.bounds.x + r.bounds.width; x1++ )
for ( int y1 = r.bounds.y; y1 < r.bounds.y + r.bounds.height; y1++ ) {
r.tiles.Add(new Vector2Int(x1, y1), Room.TileType.WALL);
int xMode = (x1 == r.bounds.x) ? -1 : (x1 == r.bounds.x + r.bounds.width - 1) ? 1 : 0;
int yMode = (y1 == r.bounds.y) ? -1 : (y1 == r.bounds.y + r.bounds.height - 1) ? 1 : 0;
r.tiles.Add(new Vector2Int(x1, y1), new GenTile(Room.TileType.WALL, GenTile.GetPosition(xMode,yMode)));
}
for ( int x1 = r.bounds.x + 1; x1 < r.bounds.x + r.bounds.width - 1; x1++ )
for ( int y1 = r.bounds.y + 1; y1 < r.bounds.y + r.bounds.height - 1; y1++ ) {
r.tiles[new Vector2Int(x1, y1)] = Room.TileType.GROUND;
r.tiles[new Vector2Int(x1, y1)].type = Room.TileType.GROUND;
}
allDoors.UnionWith(r.AllDoors());
foreach ( Vector2Int v in r.AllDoors() ) {
@ -139,7 +138,7 @@ public class DungeonGenerator {
if ( !r.bounds.Contains(v) )
throw new NotSupportedException("This is a bug where doors land in the wrong room. It should have been fixed.");
else
r.tiles[v] = Room.TileType.DOOR;
r.tiles[v].type = Room.TileType.DOOR;
}
}
@ -151,27 +150,46 @@ public class DungeonGenerator {
{
Vector2Int pos1 = new Vector2Int(x1, y1);
if (path.tiles.ContainsKey(pos1))
path.tiles[pos1] = Room.TileType.GROUND;
path.tiles[pos1].type = Room.TileType.GROUND;
else
path.tiles.Add(pos1, Room.TileType.GROUND);
for (int x2 = x1 - 1; x2 <= x1 + 1; x2++)
for (int y2 = y1 - 1; y2 <= y1 + 1; y2++)
{
Vector2Int pos2 = new Vector2Int(x2, y2);
path.tiles.Add(pos1, new GenTile(Room.TileType.GROUND));
Vector2Int pos2 = new Vector2Int(x1 + 1, y1);
if (!path.tiles.ContainsKey(pos2) && !allDoors.Contains(pos2))
path.tiles.Add(pos2, Room.TileType.WALL);
path.tiles.Add(pos2, new GenTile(Room.TileType.WALL, GenTile.Position.RIGHT));
pos2 = new Vector2Int(x1 - 1, y1);
if (!path.tiles.ContainsKey(pos2) && !allDoors.Contains(pos2))
path.tiles.Add(pos2, new GenTile(Room.TileType.WALL, GenTile.Position.LEFT));
pos2 = new Vector2Int(x1, y1 + 1);
if (!path.tiles.ContainsKey(pos2) && !allDoors.Contains(pos2))
path.tiles.Add(pos2, new GenTile(Room.TileType.WALL, GenTile.Position.TOP));
pos2 = new Vector2Int(x1, y1 - 1);
if (!path.tiles.ContainsKey(pos2) && !allDoors.Contains(pos2))
path.tiles.Add(pos2, new GenTile(Room.TileType.WALL, GenTile.Position.BOTTOM));
}
for (int x1 = r.bounds.x; x1 < r.bounds.x + r.bounds.width; x1++)
for (int y1 = r.bounds.y; y1 < r.bounds.y + r.bounds.height; y1++)
{
Vector2Int pos2 = new Vector2Int(x1 + 1, y1 + 1);
if (!path.tiles.ContainsKey(pos2) && !allDoors.Contains(pos2))
path.tiles.Add(pos2, new GenTile(Room.TileType.WALL, GenTile.Position.TOP_RIGHT));
pos2 = new Vector2Int(x1 - 1, y1 + 1);
if (!path.tiles.ContainsKey(pos2) && !allDoors.Contains(pos2))
path.tiles.Add(pos2, new GenTile(Room.TileType.WALL, GenTile.Position.TOP_LEFT));
pos2 = new Vector2Int(x1 + 1, y1 - 1);
if (!path.tiles.ContainsKey(pos2) && !allDoors.Contains(pos2))
path.tiles.Add(pos2, new GenTile(Room.TileType.WALL, GenTile.Position.BOTTOM_RIGHT));
pos2 = new Vector2Int(x1 - 1, y1 - 1);
if (!path.tiles.ContainsKey(pos2) && !allDoors.Contains(pos2))
path.tiles.Add(pos2, new GenTile(Room.TileType.WALL, GenTile.Position.BOTTOM_LEFT));
}
if (r.AllDoors().Count > 0)
throw new NotSupportedException("Paths should not have any doors");
}
//foreach (GenRoom r in rooms) {
// generateInterior (r);
//}
start = root.r;
end = null; foreach ( GenRoom r in rooms ) {
end = null;
foreach ( GenRoom r in rooms ) {
if ( end == null || r.bounds.x > end.bounds.x )
end = r;
}
@ -179,6 +197,20 @@ public class DungeonGenerator {
rooms.Remove(start);
rooms.Remove(end);
foreach (GenRoom r in rooms)
{
GenerateInterior(r);
}
foreach (Vector2Int v in allDoors) {
foreach (GenRoom r in rooms) {
for (int x = -TUNNEL_THICKNESS; x < TUNNEL_THICKNESS; x++)
for (int y = -TUNNEL_THICKNESS; y < TUNNEL_THICKNESS; y++)
if (r.tiles.ContainsKey(v + new Vector2Int(x, y)) && r.tiles[v + new Vector2Int(x, y)].type == Room.TileType.ROCK)
r.tiles[v + new Vector2Int(x, y)].type = Room.TileType.GROUND;
}
}
foreach ( GenRoom r in rooms )
makeRoomRelative(r);
makeRoomRelative(start);
@ -369,37 +401,40 @@ public class DungeonGenerator {
}
}
public static void generateInterior(GenRoom r) {
//int width = r.bounds.width;
//int height = r.bounds.height;
//Vector2Int root = new Vector2Int (1, 1);
//Random rand = new Random (System.DateTime.Now);
//for(int x = 0; i != width; ++x)
//{
// for(int y = 0; y != width; ++y)
// {
// Room.TileType tempTile;
// r.tiles.TryGetValue (root + new Vector2Int (x, y), tempTile);
// if(rand.NextDouble() <= percentageRocks && tempTile.Equals(Room.TileType.GROUND)
// {
// int clusterSize = rand.Next (1, maxRockCluster + 1);
// r.tiles.Add (root + new Vector2Int (x, y), Room.TileType.ROCK);
// for(int i = 0; i != clusterSize; ++i)
// {
// Vector2Int newRock = root + new Vector2Int(x + rand.Next(0, 2), y + rand.Next(0, 2));
// r.tiles.TryGetValue (newRock, tempTile);
// if(!tempTile.Equals(Room.TileType.GROUND))
// break;
public void GenerateInterior(GenRoom r) {
Vector2Int root = new Vector2Int (1, 1);
for (int x = r.bounds.x; x < r.bounds.x + r.bounds.width; x++)
{
for (int y = r.bounds.y; y < r.bounds.y + r.bounds.height; y++)
{
Vector2Int pos = new Vector2Int(x, y);
if (!r.tiles.ContainsKey(pos) || r.tiles[pos].type != Room.TileType.GROUND)
continue;
float prob = 0.0075f;
if (UnityEngine.Random.value > 1 - prob * 2)
{
int count = (int ) (UnityEngine.Random.value * UnityEngine.Random.value * 6);
for (int i = 0; i < count; i++) {
Vector2Int pos2 = pos + new Vector2Int(
(int)((UnityEngine.Random.value - 0.5) * 3),
(int)((UnityEngine.Random.value - 0.5) * 3));
if (r.tiles.ContainsKey(pos2) && r.tiles[pos2].type == Room.TileType.GROUND)
r.tiles[pos2].type = Room.TileType.ROCK;
}
continue;
}
if (UnityEngine.Random.value > 1 - prob)
{
r.tiles[pos].type = Room.TileType.ROCK;
continue;
}
float prob2 = 0.02f;
if (UnityEngine.Random.value > 1 - prob2)
{
r.spawnpoints.Add(pos);
}
}
}
}
}

View file

@ -4,7 +4,7 @@ using UnityEngine;
public class GenRoom {
// ---Internal for generation only---
// TODO make them package protcted please
// TODO make them package protected please
public RectInt bounds = new RectInt();
public HashSet<Vector2Int> doorsUp = new HashSet<Vector2Int>();
@ -17,7 +17,8 @@ public class GenRoom {
// The position of the anchor of the room in world space. This should be the top left corner of the room, but may be any point in the world.
public Vector2Int roomPosition;
// All positions are in room space relative to the room's anchor
public Dictionary<Vector2Int, Room.TileType> tiles = new Dictionary<Vector2Int, Room.TileType>();
public Dictionary<Vector2Int, GenTile> tiles = new Dictionary<Vector2Int, GenTile>();
public HashSet<Vector2Int> spawnpoints = new HashSet<Vector2Int>();
public float Distance(GenRoom r) {
return Math.Abs(GetCenter().x - r.GetCenter().x) + Math.Abs(GetCenter().y - r.GetCenter().y);
@ -42,8 +43,4 @@ public class GenRoom {
ret.UnionWith(doorsRight);
return ret;
}
public void generateInteror() {
}
}

View file

@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GenTile
{
public enum Position
{
BOTTOM_LEFT = 0,
BOTTOM = 1,
BOTTOM_RIGHT = 2,
LEFT = 3,
CENTER = 4,
RIGHT = 5,
TOP_LEFT = 6,
TOP = 7,
TOP_RIGHT = 8
}
public Room.TileType type;
public Position position;
public GenTile()
{
}
public GenTile(Room.TileType type)
{
this.type = type;
}
public GenTile(Room.TileType type, Position position)
{
this.type = type;
this.position = position;
}
public static Position GetPosition(int xMode, int yMode) {
return (Position) ((xMode + 1) + (yMode + 1) * 3);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1b8dce5bdb3204011a32ee1b512a4296
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -11,58 +11,17 @@ public class GenerationProcessor {
this.prefabs = prefabs;
}
public GameObject ProcessRoom(Dictionary<Vector2Int, Room.TileType> d) {
public GameObject ProcessRoom(Dictionary<Vector2Int, GenTile> tiles) {
GameObject root = new GameObject {
name = "Room"
};
foreach ( Vector2Int v in d.Keys ) {
bool left = false;
bool top = false;
bool right = false;
bool bottom = false;
// left bound
if ( d.ContainsKey(v + new Vector2Int(-1, 0)) ) {
if ( d[v + new Vector2Int(-1, 0)] == d[v] ) {
left = true;
}
}
// top bound
if ( d.ContainsKey(v + new Vector2Int(0, 1)) ) {
if ( d[v + new Vector2Int(0, 1)] == d[v] ) {
top = true;
}
}
// right bound
if ( d.ContainsKey(v + new Vector2Int(1, 0)) ) {
if ( d[v + new Vector2Int(1, 0)] == d[v] ) {
right = true;
}
}
// bottom bound
if ( d.ContainsKey(v + new Vector2Int(0, -1)) ) {
if ( d[v + new Vector2Int(0, -1)] == d[v] ) {
bottom = true;
}
}
foreach ( Vector2Int v in tiles.Keys ) {
ExtendedTileType type = ExtendedTileType.Ground;
// ---------------------------------------------------------------------------------------------------------------------------------------------
// ^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~
//
// *** W A R N I N G B A D C O D E A H E A D ! ! ! ***
// __________________________________________________________________________
//
// DON'T WATCH, UNLESS YOU WANT TO GET TRAUMATIZED!
//
// ^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~^~!~
// ---------------------------------------------------------------------------------------------------------------------------------------------
switch ( d[v] ) {
int rotation = 0;
switch ( tiles[v].type ) {
case Room.TileType.WALL:
type = ExtendedTileType.BorderSingle;
if ( top && left && d.ContainsKey(v + new Vector2Int(-1, -1)) || top && right && d.ContainsKey(v + new Vector2Int(1, -1)) || right && bottom && d.ContainsKey(v + new Vector2Int(1, 1)) || left && bottom && d.ContainsKey(v + new Vector2Int(-1, 1)) ) {
type = ExtendedTileType.BorderOuter;
} else if ( top && left || top && right || right && bottom || left && bottom ) {
type = ExtendedTileType.BorderInner;
}
type = getCorrectWallType(tiles, v);
rotation = getCorrectWallRotation(type, tiles[v].position);
break;
case Room.TileType.GROUND:
type = ExtendedTileType.Ground;
@ -71,68 +30,142 @@ public class GenerationProcessor {
type = ExtendedTileType.Door;
break;
case Room.TileType.ROCK:
type = ExtendedTileType.Rock;
if ( top && !right && !left && !bottom ) {
type = ExtendedTileType.RockU;
}
if ( left && !right && !bottom && !top ) {
type = ExtendedTileType.RockL;
}
if ( right && !bottom && !left && !top ) {
type = ExtendedTileType.RockR;
}
if ( bottom && !right && !left && !top ) {
type = ExtendedTileType.RockD;
}
if ( left && top && !bottom && !right ) {
type = ExtendedTileType.RockLU;
}
if ( left && right && !top && !bottom ) {
type = ExtendedTileType.RockLR;
}
if ( left && bottom && !right && !top ) {
type = ExtendedTileType.RockLD;
}
if ( top && right && !left && !bottom ) {
type = ExtendedTileType.RockUR;
}
if ( top && bottom && !left && !right ) {
type = ExtendedTileType.RockUD;
}
if ( right && bottom && !top && !left ) {
type = ExtendedTileType.RockRD;
}
if ( left && top && bottom && !right ) {
type = ExtendedTileType.RockLUD;
}
if ( left && top && right && !bottom ) {
type = ExtendedTileType.RockLUR;
}
if ( top && right && bottom && !left ) {
type = ExtendedTileType.RockURD;
}
if ( left && right && bottom && !top ) {
type = ExtendedTileType.RockLRD;
}
if ( left && top && right && bottom ) {
type = ExtendedTileType.RockLURD;
}
type = getCorrectRockType(tiles, v);
break;
}
CreateGOFromType(v, type, root);
CreateGOFromType(v, rotation, type, root);
}
return root;
}
private GameObject CreateGOFromType(Vector2 v, ExtendedTileType t, GameObject root) {
private GameObject CreateGOFromType(Vector2 v, int rotation, ExtendedTileType t, GameObject root) {
GameObject tmp = null;
//if (t == ExtendedTileType.BorderInner || t == ExtendedTileType.BorderOuter || t == ExtendedTileType.BorderInner)
// CreateGOFromType(v, rotation, ExtendedTileType.Ground, root);
if ( prefabs.ContainsKey(t) && root != null ) {
tmp = GameObject.Instantiate(prefabs[t], root.transform);
tmp = Object.Instantiate(prefabs[t], root.transform);
tmp.transform.position = v;
tmp.transform.Rotate(new Vector3(0, 0, rotation));
}
return tmp;
}
private int CountSpecificNeighbours(Dictionary<Vector2Int, GenTile> tiles, Vector2Int position, Room.TileType type) {
int counter = 0;
Vector2Int toCheck = position + new Vector2Int(0, -1);
if (tiles.ContainsKey(toCheck) && tiles[toCheck].type == type)
counter++;
toCheck = position + new Vector2Int(-1, 0);
if (tiles.ContainsKey(toCheck) && tiles[toCheck].type == type)
counter++;
toCheck = position + new Vector2Int(0, 1);
if (tiles.ContainsKey(toCheck) && tiles[toCheck].type == type)
counter++;
toCheck = position + new Vector2Int(1, 0);
if (tiles.ContainsKey(toCheck) && tiles[toCheck].type == type)
counter++;
return counter;
}
private ExtendedTileType getCorrectWallType(Dictionary<Vector2Int, GenTile> tiles, Vector2Int position){
int groundNumber = CountSpecificNeighbours(tiles, position, Room.TileType.GROUND) + CountSpecificNeighbours(tiles, position, Room.TileType.ROCK);
switch(groundNumber){
case 0:
return ExtendedTileType.BorderInner;
case 2:
return ExtendedTileType.BorderOuter;
default:
return ExtendedTileType.BorderSingle;
}
}
private int getCorrectWallRotation(ExtendedTileType type, GenTile.Position position) {
int rotation = 0;
switch (type) {
case ExtendedTileType.BorderSingle:
switch (position) {
case GenTile.Position.BOTTOM:
rotation = 180;
break;
case GenTile.Position.LEFT:
rotation = 90;
break;
case GenTile.Position.TOP:
rotation = 0;
break;
case GenTile.Position.RIGHT:
rotation = 270;
break;
}
break;
case ExtendedTileType.BorderInner:
switch (position) {
case GenTile.Position.BOTTOM_LEFT:
rotation = 90;
break;
case GenTile.Position.TOP_LEFT:
rotation = 0;
break;
case GenTile.Position.TOP_RIGHT:
rotation = 270;
break;
case GenTile.Position.BOTTOM_RIGHT:
rotation = 180;
break;
}
break;
}
return rotation;
}
private ExtendedTileType getCorrectRockType(Dictionary<Vector2Int, GenTile> tiles, Vector2Int position) {
int meta = 0;
Vector2Int toCheck = position + new Vector2Int(0, -1);
if (tiles.ContainsKey(toCheck) && tiles[toCheck].type == Room.TileType.ROCK)
meta += 1;
toCheck = position + new Vector2Int(-1, 0);
if (tiles.ContainsKey(toCheck) && tiles[toCheck].type == Room.TileType.ROCK)
meta += 2;
toCheck = position + new Vector2Int(0, 1);
if (tiles.ContainsKey(toCheck) && tiles[toCheck].type == Room.TileType.ROCK)
meta += 4;
toCheck = position + new Vector2Int(1, 0);
if (tiles.ContainsKey(toCheck) && tiles[toCheck].type == Room.TileType.ROCK)
meta += 8;
switch(meta) {
case 1:
return ExtendedTileType.RockD;
case 2:
return ExtendedTileType.RockL;
case 3:
return ExtendedTileType.RockLD;
case 4:
return ExtendedTileType.RockU;
case 5:
return ExtendedTileType.RockUD;
case 6:
return ExtendedTileType.RockLU;
case 7:
return ExtendedTileType.RockLUD;
case 8:
return ExtendedTileType.RockR;
case 9:
return ExtendedTileType.RockRD;
case 10:
return ExtendedTileType.RockLR;
case 11:
return ExtendedTileType.RockLRD;
case 12:
return ExtendedTileType.RockUR;
case 13:
return ExtendedTileType.RockURD;
case 14:
return ExtendedTileType.RockLUR;
case 15:
return ExtendedTileType.RockLURD;
default:
return ExtendedTileType.Rock;
}
}
}

View file

@ -24,6 +24,9 @@ public class EntityObjective : Objective {
/// </summary>
/// <param name="ply">Player</param>
public override void ActivateGoal(Player ply) {
if ( activated )
return;
activated = true;
base.ActivateGoal(ply);
foreach ( GameObject i in prefabList ) {
Debug.Log("[ROOMS] Spawning Entity...");

View file

@ -1,8 +1,10 @@
public abstract class Objective {
using UnityEngine;
public abstract class Objective {
protected Room room;
protected Player player;
bool activated;
bool finished;
protected bool activated;
protected bool finished;
/// <summary>
/// Constructs a new Objective instance.
@ -34,6 +36,7 @@
protected virtual void ReachedGoal() {
finished = true;
room.Unlock();
Debug.Log("[ROOM] Goal reached. Doors will open.");
}
/// <summary>

View file

@ -20,11 +20,14 @@ public class StartObjective : Objective {
/// </summary>
/// <param name="ply">Player is ignored </param>
public override void ActivateGoal(Player player) {
if ( activated )
return;
if ( room.GetSpawnpoints().Count > 0 ) {
GameObject ply = GameObject.Instantiate(playerPrefab);
ply.transform.position = room.GetSpawnpoints()[0].position;
player = ply.GetComponent<Player>();
base.ActivateGoal(player);
UpdateGoal();
}
}

View file

@ -20,7 +20,7 @@ public class Room : MonoBehaviour {
private Objective objective;
// Use this for initialization
void Start() {
void Awake() {
doors = new List<Door>();
if ( doorsRootObject != null ) {
foreach ( Door d in doorsRootObject.GetComponentsInChildren<Door>() ) {
@ -38,7 +38,7 @@ public class Room : MonoBehaviour {
}
//Debug.Log("[ROOMS] Spawnpoints: " + spawnpoints.Count);
}
//Unlock();
Unlock();
}
/// <summary>
@ -62,6 +62,7 @@ public class Room : MonoBehaviour {
}
//Debug.Log("[ROOMS] Spawnpoints: " + spawnpoints.Count);
}
Unlock(); // Ok to do so?
}
/// <summary>

View file

@ -1,6 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class UIController : MonoBehaviour
{
@ -12,47 +14,59 @@ public class UIController : MonoBehaviour
NotificationManager notifications;
[SerializeField]
GameObject gameOverPanel;
GameObject restartUIPanel;
[SerializeField]
HealthbarController healthcontroller;
[SerializeField]
int mainMenuSceneIndex = 0;
int firstSceneIndex = 1;
public void ShowPauseMenu()
{
void Update() {
if (Input.GetKey(KeyCode.R) && GameController.instance.GameEnded()) {
LoadSceneByIndex(firstSceneIndex);
}
}
public void ShowPauseMenu() {
pauseMenu.SetActive(true);
}
public void ClosePauseMenu()
{
public void ClosePauseMenu() {
pauseMenu.SetActive(false);
}
public void LoadSceneByIndex(int index)
{
public void LoadSceneByIndex(int index) {
Debug.Log("Loaded scene " + index);
UnityEngine.SceneManagement.SceneManager.LoadScene(index);
SceneManager.LoadScene(index);
}
public void QuitGame()
{
public void QuitGame() {
Debug.Log("Quit game");
Application.Quit();
}
public void ShowGameOverUI()
{
if (gameOverPanel != null) {
Debug.Log("Loaded Canvas");
gameOverPanel.SetActive(true);
public void ShowGameOverUI() {
ShowRestartUI(false);
}
public void ShowWinUI() {
ShowRestartUI(true);
}
void ShowRestartUI(bool won) {
string headerText = won ? "You won!" : "Game Over";
if (restartUIPanel != null) {
restartUIPanel.SetActive(true);
restartUIPanel.GetComponent<Text>().text = headerText;
} else {
Debug.Log("No game over panel assigned");
Debug.Log("No restart panel assigned");
}
}
public void InitHealthController(Player ply)
{
public void InitHealthController(Player ply) {
healthcontroller.SetPlayer(ply);
}

View file

@ -43,7 +43,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 1000
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -67,6 +67,39 @@ TextureImporter:
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []

View file

@ -29,7 +29,7 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
filterMode: 0
aniso: -1
mipBias: -1
wrapU: 1
@ -43,7 +43,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 1000
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -67,6 +67,39 @@ TextureImporter:
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -29,7 +29,7 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
filterMode: 2
aniso: -1
mipBias: -1
wrapU: 1

View file

@ -1,5 +1,6 @@
fileFormatVersion: 2
guid: 7ac7c7d8f5fd5cf498c937b4891f6410
guid: 436c84837597640498e273a97bba0c01
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

View file

@ -0,0 +1,84 @@
fileFormatVersion: 2
guid: de561662158dba54da33be008537b481
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: a8432b08b19559d4c8f8d64c9f517952
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,84 @@
fileFormatVersion: 2
guid: 1c065c2aa597bf141a1b8ca38bde7a94
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 2feb659d9a65d684591e3364d73a7027
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,84 @@
fileFormatVersion: 2
guid: a5b609314fdfae040aabe4e6601291df
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 2a9a4d22d13f51f49b703caa26ad55d2
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View file

@ -4,10 +4,10 @@
Physics2DSettings:
m_ObjectHideFlags: 0
serializedVersion: 3
m_Gravity: {x: 0, y: -9.81}
m_Gravity: {x: 0, y: 0}
m_DefaultMaterial: {fileID: 0}
m_VelocityIterations: 8
m_PositionIterations: 3
m_VelocityIterations: 10
m_PositionIterations: 4
m_VelocityThreshold: 1
m_MaxLinearCorrection: 0.2
m_MaxAngularCorrection: 8
@ -52,4 +52,4 @@ Physics2DSettings:
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
m_LayerCollisionMatrix: c9ffffffc8ffffffc8ffffffffffffffc8ffffffc8ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_LayerCollisionMatrix: c9ffffffc8ffffffc8fcffffffffffffc8ffffffc8fffffffffffffffffffffffbfffffffbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

View file

@ -8,6 +8,7 @@ TagManager:
- door
- DoorRoot
- SpawnlistRoot
- Enemy
layers:
- Default
- TransparentFX
@ -17,8 +18,8 @@ TagManager:
- UI
-
-
-
-
- Player
- Mobs
-
-
-