Commit 29e5f60a authored by Christopher Benes's avatar Christopher Benes
Browse files

Merge branch 'master' of gitlab.fsi.hochschule-trier.de:GameDevWeek/ws-18_19/unity/suck-it

parents 04d6b1db 7cf6460a
...@@ -15,7 +15,7 @@ GameObject: ...@@ -15,7 +15,7 @@ GameObject:
- component: {fileID: 5372445436103654034} - component: {fileID: 5372445436103654034}
m_Layer: 0 m_Layer: 0
m_Name: Destroyable_Thing m_Name: Destroyable_Thing
m_TagString: Untagged m_TagString: DestroyableByFire
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
...@@ -68,8 +68,8 @@ SpriteRenderer: ...@@ -68,8 +68,8 @@ SpriteRenderer:
m_AutoUVMaxDistance: 0.5 m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89 m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: -614652393
m_SortingLayer: 0 m_SortingLayer: 4
m_SortingOrder: 0 m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: d0cee4e8b659c5646ac1e205b88a3256, type: 3} m_Sprite: {fileID: 21300000, guid: d0cee4e8b659c5646ac1e205b88a3256, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
......
...@@ -13,7 +13,12 @@ GameObject: ...@@ -13,7 +13,12 @@ GameObject:
- component: {fileID: 2055293003418080559} - component: {fileID: 2055293003418080559}
- component: {fileID: 52145075018362291} - component: {fileID: 52145075018362291}
- component: {fileID: 52145075018362284} - component: {fileID: 52145075018362284}
- component: {fileID: 52145075018362287} - component: {fileID: 779623631694574805}
- component: {fileID: 352228602}
- component: {fileID: 352228603}
- component: {fileID: 352228604}
- component: {fileID: 352228605}
- component: {fileID: 352228606}
m_Layer: 10 m_Layer: 10
m_Name: Player m_Name: Player
m_TagString: Player m_TagString: Player
...@@ -30,7 +35,7 @@ Transform: ...@@ -30,7 +35,7 @@ Transform:
m_GameObject: {fileID: 52145075018362288} m_GameObject: {fileID: 52145075018362288}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 2, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
...@@ -72,7 +77,7 @@ SpriteRenderer: ...@@ -72,7 +77,7 @@ SpriteRenderer:
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: d0cee4e8b659c5646ac1e205b88a3256, type: 3} m_Sprite: {fileID: 21300000, guid: c8a742c1f2ebb43b9afe34a47304c051, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0
m_FlipY: 0 m_FlipY: 0
...@@ -109,25 +114,35 @@ MonoBehaviour: ...@@ -109,25 +114,35 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Speed: 30 m_Speed: 30
m_JumpForce: 10 m_JumpForce: 10
m_fallMultiplier: 2.5
m_lowJumpMultiplier: 2
m_MovementSmoothing: 0.05 m_MovementSmoothing: 0.05
m_AirControl: 1 m_AirControl: 1
m_CanSwim: 1
m_WhatIsGround: m_WhatIsGround:
serializedVersion: 2 serializedVersion: 2
m_Bits: 512 m_Bits: 512
m_GroundCheck: {fileID: 52145075018362285} m_GroundCheck: {fileID: 52145075018362285}
m_GroundCheckDistance: 1 m_GroundCheckDistance: 0.6
m_GroundedRadius: 0.25 m_GroundedRadius: 0.25
m_GroundedOffset: {x: 0, y: 0} m_GroundedOffset: {x: -0.09, y: -0.5}
m_GroundMaxSlopeAngle: 45
m_SecondsWaitToJump: 0.5 m_SecondsWaitToJump: 0.5
m_MaxJumpCount: 1 m_MaxJumpCount: 1
m_fallMultiplier: 2.5
m_lowJumpMultiplier: 2
OnLandEvent: OnLandEvent:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0, m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null Culture=neutral, PublicKeyToken=null
OnSwimEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
OnJumpEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!50 &52145075018362284 --- !u!50 &52145075018362284
Rigidbody2D: Rigidbody2D:
serializedVersion: 4 serializedVersion: 4
...@@ -149,8 +164,8 @@ Rigidbody2D: ...@@ -149,8 +164,8 @@ Rigidbody2D:
m_SleepingMode: 1 m_SleepingMode: 1
m_CollisionDetection: 1 m_CollisionDetection: 1
m_Constraints: 4 m_Constraints: 4
--- !u!61 &52145075018362287 --- !u!70 &779623631694574805
BoxCollider2D: CapsuleCollider2D:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
...@@ -162,16 +177,86 @@ BoxCollider2D: ...@@ -162,16 +177,86 @@ BoxCollider2D:
m_IsTrigger: 0 m_IsTrigger: 0
m_UsedByEffector: 0 m_UsedByEffector: 0
m_UsedByComposite: 0 m_UsedByComposite: 0
m_Offset: {x: 0, y: 0} m_Offset: {x: -0.03, y: -0.36}
m_SpriteTilingProperty: m_Size: {x: 1.05, y: 1.39}
border: {x: 0, y: 0, z: 0, w: 0} m_Direction: 0
pivot: {x: 0.5, y: 0.5} --- !u!114 &352228602
oldSize: {x: 1, y: 1} MonoBehaviour:
newSize: {x: 0.16, y: 0.16} m_ObjectHideFlags: 0
adaptiveTilingThreshold: 0.5 m_CorrespondingSourceObject: {fileID: 0}
drawMode: 0 m_PrefabInstance: {fileID: 0}
adaptiveTiling: 0 m_PrefabAsset: {fileID: 0}
m_AutoTiling: 0 m_GameObject: {fileID: 52145075018362288}
serializedVersion: 2 m_Enabled: 1
m_Size: {x: 1, y: 1} m_EditorHideFlags: 0
m_EdgeRadius: 0 m_Script: {fileID: 11500000, guid: 2f8415a7fda2c084e87b3caa1b43ffbf, type: 3}
m_Name:
m_EditorClassIdentifier:
state: {fileID: 11400000, guid: c5777bcc7b64ce24c9bd65d2c4b7c639, type: 2}
onElementInfused: {fileID: 11400000, guid: 7e5b80a8353af1846a878c3a997bdb4a, type: 2}
--- !u!114 &352228603
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 52145075018362288}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: adc21094da13d8649a490855a137565f, type: 3}
m_Name:
m_EditorClassIdentifier:
cooldown: 0
volleySize: 0
launchPower: 0
attackSpeed: 0
shotSpawn: {fileID: 0}
elementalAttack: {fileID: 0}
--- !u!114 &352228604
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 52145075018362288}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ad90db0185377664288543ce4696c6b8, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &352228605
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 52145075018362288}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 83eb4399ff535ee4cbc76de3b8a32e46, type: 3}
m_Name:
m_EditorClassIdentifier:
Cooldown: 0
volleySize: 0
launchPower: 0
attackSpeed: 0
shotSpawn: {fileID: 0}
fireBall: {fileID: 0}
--- !u!114 &352228606
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 52145075018362288}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5a8392b2d467dfc428ede6cd785337f2, type: 3}
m_Name:
m_EditorClassIdentifier:
weight: 0
isPerformingAction: 0
windAttack: {fileID: 0}
Cooldown: 0
attackRange: 0
firePower: 0
...@@ -278,12 +278,12 @@ PrefabInstance: ...@@ -278,12 +278,12 @@ PrefabInstance:
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc, - target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3} type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 8.68 value: 1.33
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc, - target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3} type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: 3.5 value: 2.03
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc, - target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3} type: 3}
...@@ -313,7 +313,7 @@ PrefabInstance: ...@@ -313,7 +313,7 @@ PrefabInstance:
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc, - target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 4 value: 5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc, - target: {fileID: 7340435369038607274, guid: 938701439f7d9654da1b920d73ccf2cc,
type: 3} type: 3}
...@@ -666,7 +666,7 @@ PrefabInstance: ...@@ -666,7 +666,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4738352637052488, guid: 6cd7f8e10f89642fd88661db0d3f3827, type: 3} - target: {fileID: 4738352637052488, guid: 6cd7f8e10f89642fd88661db0d3f3827, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 5 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4738352637052488, guid: 6cd7f8e10f89642fd88661db0d3f3827, type: 3} - target: {fileID: 4738352637052488, guid: 6cd7f8e10f89642fd88661db0d3f3827, type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x
...@@ -1181,16 +1181,6 @@ PrefabInstance: ...@@ -1181,16 +1181,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3962879857309384165, guid: 926b80f66a4f61b428fa10deff5f7842,
type: 3}
propertyPath: m_SortingLayerID
value: -614652393
objectReference: {fileID: 0}
- target: {fileID: 3962879857309384165, guid: 926b80f66a4f61b428fa10deff5f7842,
type: 3}
propertyPath: m_SortingLayer
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 926b80f66a4f61b428fa10deff5f7842, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 926b80f66a4f61b428fa10deff5f7842, type: 3}
--- !u!1 &1156108368 --- !u!1 &1156108368
......
...@@ -628,6 +628,148 @@ PrefabInstance: ...@@ -628,6 +628,148 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4512b8eb550115443bbba2ecd59a960c, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 4512b8eb550115443bbba2ecd59a960c, type: 3}
--- !u!1 &1644657071
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1644657076}
- component: {fileID: 1644657075}
- component: {fileID: 1644657073}
- component: {fileID: 1644657072}
- component: {fileID: 1644657074}
m_Layer: 0
m_Name: Obstacle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1644657072
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1644657071}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5c135c3fe901cf4696abeebd2ac1f28, type: 3}
m_Name:
m_EditorClassIdentifier:
force: 1
--- !u!61 &1644657073
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1644657071}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
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: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!50 &1644657074
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1644657071}
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!212 &1644657075
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1644657071}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
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: d0325f4b5843676408fd1f628635d218, type: 3}
m_Color: {r: 0.41509432, g: 0.108125485, b: 0.06852971, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!4 &1644657076
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1644657071}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1685552533 --- !u!1 &1685552533
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -4,22 +4,36 @@ using UnityEngine; ...@@ -4,22 +4,36 @@ using UnityEngine;
public class CameraController : MonoBehaviour public class CameraController : MonoBehaviour
{ {
public GameObject player; //Public variable to store a reference to the player game object public Transform target; //Public variable to store a reference to the player game object
public float smoothSpeed = 0.5f;
public bool lookAt = false;
public float maxDistance = 5f;
private Vector3 offset; //Private variable to store the offset distance between the player and camera private Vector3 offset; //Private variable to store the offset distance between the player and camera
// Use this for initialization // Use this for initialization
void Start() void Start()
{ {
target = GameObject.FindGameObjectWithTag("Player").transform;
//Calculate and store the offset value by getting the distance between the player's position and camera's position. //Calculate and store the offset value by getting the distance between the player's position and camera's position.
offset = transform.position - player.transform.position; offset = transform.position - target.transform.position;
if (offset.sqrMagnitude > maxDistance * maxDistance)
{
offset.x = 0f;
offset.y = 0f;
}
} }
// LateUpdate is called after Update each frame // LateUpdate is called after Update each frame
void LateUpdate() void FixedUpdate()
{ {
// Set the position of the camera's transform to be the same as the player's, but offset by the calculated offset distance. // Set the position of the camera's transform to be the same as the player's, but offset by the calculated offset distance.
transform.position = player.transform.position + offset; //transform.position = player.transform.position + offset;
Vector3 desiredPosition = target.position + offset;
Vector3 smoothedPosition = Vector3.Lerp(transform.position, desiredPosition, smoothSpeed);
transform.position = smoothedPosition;
if(lookAt)transform.LookAt(target);
} }
} }
...@@ -14,6 +14,9 @@ public class AI_WindAttack : WeightedAction ...@@ -14,6 +14,9 @@ public class AI_WindAttack : WeightedAction
public float Cooldown; public float Cooldown;
public float attackRange; public float attackRange;
public float firePower; public float firePower;
public int damage;
public float destroyTime;
public float thrust;
// Use this for initialization // Use this for initialization
void Start() void Start()
...@@ -33,10 +36,6 @@ public class AI_WindAttack : WeightedAction ...@@ -33,10 +36,6 @@ public class AI_WindAttack : WeightedAction
return; return;
} }
Vector2 dir = Vector2.zero;
direction = dir;
myAI.desiredAction.Add(this); myAI.desiredAction.Add(this);
} }
...@@ -65,9 +64,4 @@ public class AI_WindAttack : WeightedAction ...@@ -65,9 +64,4 @@ public class AI_WindAttack : WeightedAction
Vector3 rotatedVector = Quaternion.AngleAxis(0, Vector3.forward) * attackdir; Vector3 rotatedVector = Quaternion.AngleAxis(0, Vector3.forward) * attackdir;
body.velocity = new Vector2(rotatedVector.x * firePower, rotatedVector.y * firePower); body.velocity = new Vector2(rotatedVector.x * firePower, rotatedVector.y * firePower);
} }
private void OnDrawGizmosSelected()
{
Gizmos.color = Color.red;
}
} }
...@@ -3,10 +3,17 @@ using UnityEngine; ...@@ -3,10 +3,17 @@ using UnityEngine;
public class AI_WindProjectile : MonoBehaviour public class AI_WindProjectile : MonoBehaviour
{ {
public float destroyTime = 1f; private float destroyTime;
private float thrust;