Commit 24c814f0 authored by Christopher Benes's avatar Christopher Benes

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

parents ed9c1211 3480a93a
...@@ -12,17 +12,17 @@ MonoBehaviour: ...@@ -12,17 +12,17 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 353b156b7c59b1c45a8767d7500b31fb, type: 3} m_Script: {fileID: 11500000, guid: 353b156b7c59b1c45a8767d7500b31fb, type: 3}
m_Name: PlayerState m_Name: PlayerState
m_EditorClassIdentifier: m_EditorClassIdentifier:
currentInfusedElement: 0 currentInfusedElement: 2
currentMoveState: currentMoveState:
jumpForce: 15 jumpForce: 10
smoothing: 0.03 smoothing: 0.03
airControl: 1 airControl: 1
canSwim: 1 canSwim: 1
moveSpeed: 30 moveSpeed: 20
maxJumpCount: 1 maxJumpCount: 1
mass: 1 mass: 1
gravity: 3 gravity: 3
movementStates: {fileID: 11400000, guid: c757aad6925b37a46b916f609fa9012b, type: 2} movementStates: {fileID: 11400000, guid: c757aad6925b37a46b916f609fa9012b, type: 2}
onElementInfused: {fileID: 11400000, guid: 7e5b80a8353af1846a878c3a997bdb4a, type: 2} onElementInfused: {fileID: 11400000, guid: 7e5b80a8353af1846a878c3a997bdb4a, type: 2}
onChargeChange: {fileID: 11400000, guid: 6ec6544f645a9d1458383b111fcaf8b6, type: 2} onChargeChange: {fileID: 11400000, guid: 6ec6544f645a9d1458383b111fcaf8b6, type: 2}
charges: 0 charges: 1
...@@ -143,3 +143,4 @@ MonoBehaviour: ...@@ -143,3 +143,4 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
destroyTime: 3 destroyTime: 3
pushFactor: 5 pushFactor: 5
pushEnemyFactor: 1000
...@@ -48,7 +48,7 @@ Rigidbody2D: ...@@ -48,7 +48,7 @@ Rigidbody2D:
m_Simulated: 1 m_Simulated: 1
m_UseFullKinematicContacts: 0 m_UseFullKinematicContacts: 0
m_UseAutoMass: 0 m_UseAutoMass: 0
m_Mass: 10000 m_Mass: 1
m_LinearDrag: 5 m_LinearDrag: 5
m_AngularDrag: 0.05 m_AngularDrag: 0.05
m_GravityScale: 5 m_GravityScale: 5
......
...@@ -15,6 +15,7 @@ GameObject: ...@@ -15,6 +15,7 @@ GameObject:
- component: {fileID: 5627041003248903908} - component: {fileID: 5627041003248903908}
- component: {fileID: 8217090596470256212} - component: {fileID: 8217090596470256212}
- component: {fileID: 820980056} - component: {fileID: 820980056}
- component: {fileID: 4551173074651665413}
m_Layer: 14 m_Layer: 14
m_Name: Feuer-Gegner m_Name: Feuer-Gegner
m_TagString: Fire m_TagString: Fire
...@@ -49,7 +50,7 @@ Rigidbody2D: ...@@ -49,7 +50,7 @@ Rigidbody2D:
m_Simulated: 1 m_Simulated: 1
m_UseFullKinematicContacts: 0 m_UseFullKinematicContacts: 0
m_UseAutoMass: 0 m_UseAutoMass: 0
m_Mass: 10000 m_Mass: 1
m_LinearDrag: 5 m_LinearDrag: 5
m_AngularDrag: 0.05 m_AngularDrag: 0.05
m_GravityScale: 3 m_GravityScale: 3
...@@ -177,6 +178,24 @@ Animator: ...@@ -177,6 +178,24 @@ Animator:
m_HasTransformHierarchy: 1 m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1 m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0 m_KeepAnimatorControllerStateOnDisable: 0
--- !u!114 &4551173074651665413
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1634356314439590}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3c0ce2eb523274b6fa61fccbf0227d85, type: 3}
m_Name:
m_EditorClassIdentifier:
m_MaxLife: 1
LostLife:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!1 &8738143122139646636 --- !u!1 &8738143122139646636
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -50,7 +50,7 @@ Rigidbody2D: ...@@ -50,7 +50,7 @@ Rigidbody2D:
m_Simulated: 1 m_Simulated: 1
m_UseFullKinematicContacts: 0 m_UseFullKinematicContacts: 0
m_UseAutoMass: 0 m_UseAutoMass: 0
m_Mass: 10 m_Mass: 1
m_LinearDrag: 5 m_LinearDrag: 5
m_AngularDrag: 0.05 m_AngularDrag: 0.05
m_GravityScale: 5 m_GravityScale: 5
......
...@@ -51,7 +51,7 @@ Rigidbody2D: ...@@ -51,7 +51,7 @@ Rigidbody2D:
m_Simulated: 1 m_Simulated: 1
m_UseFullKinematicContacts: 0 m_UseFullKinematicContacts: 0
m_UseAutoMass: 0 m_UseAutoMass: 0
m_Mass: 3 m_Mass: 1
m_LinearDrag: 5 m_LinearDrag: 5
m_AngularDrag: 0.05 m_AngularDrag: 0.05
m_GravityScale: 0 m_GravityScale: 0
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
fileFormatVersion: 2
guid: b7bf4d880d42d444f8da98c29b8ee5ec
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: a557c41513022e744831753cb4ad512f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -1494,129 +1494,6 @@ Transform: ...@@ -1494,129 +1494,6 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 13 m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &641165127
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8474030530107407617, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_Name
value: Minimap
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_RootOrder
value: 21
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8474030530107407621, guid: d15c6360ddc5f6d45994b7a8ad351996,
type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 574052652, guid: d15c6360ddc5f6d45994b7a8ad351996, type: 3}
propertyPath: player
value:
objectReference: {fileID: 435083157}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d15c6360ddc5f6d45994b7a8ad351996, type: 3}
--- !u!1001 &674588446 --- !u!1001 &674588446
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -2749,6 +2626,11 @@ PrefabInstance: ...@@ -2749,6 +2626,11 @@ PrefabInstance:
propertyPath: m_Pivot.y propertyPath: m_Pivot.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2362585430913481208, guid: 35f9d08058ae666458aadeaeab77cf00,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 35f9d08058ae666458aadeaeab77cf00, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 35f9d08058ae666458aadeaeab77cf00, type: 3}
--- !u!1001 &1020248502 --- !u!1001 &1020248502
...@@ -2801,7 +2683,7 @@ PrefabInstance: ...@@ -2801,7 +2683,7 @@ PrefabInstance:
- target: {fileID: 2888112478438871478, guid: 50a0ddec8ac259c46a58a6b5324a759d, - target: {fileID: 2888112478438871478, guid: 50a0ddec8ac259c46a58a6b5324a759d,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 22 value: 21
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2888112478438871478, guid: 50a0ddec8ac259c46a58a6b5324a759d, - target: {fileID: 2888112478438871478, guid: 50a0ddec8ac259c46a58a6b5324a759d,
type: 3} type: 3}
...@@ -2868,6 +2750,11 @@ PrefabInstance: ...@@ -2868,6 +2750,11 @@ PrefabInstance:
propertyPath: m_Pivot.y propertyPath: m_Pivot.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2362585432661986845, guid: 50a0ddec8ac259c46a58a6b5324a759d,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 50a0ddec8ac259c46a58a6b5324a759d, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 50a0ddec8ac259c46a58a6b5324a759d, type: 3}
--- !u!1 &1025537126 --- !u!1 &1025537126
......
This diff is collapsed.
fileFormatVersion: 2
guid: ce014a08630f7db4e8960e2e3e639b42
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -90,7 +90,7 @@ public class AI_DashAttack : WeightedAction ...@@ -90,7 +90,7 @@ public class AI_DashAttack : WeightedAction
IEnumerator windUp(Vector3 attackdir) IEnumerator windUp(Vector3 attackdir)
{ {
float updateTarget = windUpTime; float updateTarget = windUpTime;
float currentTime = 0.0f; //float currentTime = 0.0f;
//do //do
//{ //{
......
...@@ -27,8 +27,8 @@ namespace _Game.Scripts.Level_Hazards ...@@ -27,8 +27,8 @@ namespace _Game.Scripts.Level_Hazards
if (other.gameObject.layer == LayerMask.NameToLayer("Player") || other.gameObject.layer == LayerMask.NameToLayer("Enemy") || if (other.gameObject.layer == LayerMask.NameToLayer("Player") || other.gameObject.layer == LayerMask.NameToLayer("Enemy") ||
other.gameObject.CompareTag("Fire")) other.gameObject.CompareTag("Fire"))
{ {
_rigidbody2D.velocity = Vector2.zero;
_rigidbody2D.bodyType = RigidbodyType2D.Dynamic; _rigidbody2D.bodyType = RigidbodyType2D.Dynamic;
_rigidbody2D.velocity = Vector2.zero;
} }
} }
} }
......
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
...@@ -42,8 +43,8 @@ public class MovementController : MonoBehaviour ...@@ -42,8 +43,8 @@ public class MovementController : MonoBehaviour
private ContactFilter2D m_ContactFilter2D; private ContactFilter2D m_ContactFilter2D;
private Vector3 m_CurrentGroundNormal; private Vector3 m_CurrentGroundNormal;
private bool m_isMoving = false; //private bool m_isMoving = false;
private bool m_isJumping = false; //private bool m_isJumping = false;
private Vector2 m_Movement = Vector2.zero; private Vector2 m_Movement = Vector2.zero;
[Header("Events")] [Space] [Header("Events")] [Space]
......
...@@ -6,6 +6,7 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water ...@@ -6,6 +6,7 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water
{ {
public float destroyTime = 2.0f; public float destroyTime = 2.0f;
public float pushFactor = 1.0f; public float pushFactor = 1.0f;
public float pushEnemyFactor = 1.0f;
private float _startTime; private float _startTime;
private float _deltaTime; private float _deltaTime;
private float _newScaleFactor; private float _newScaleFactor;
...@@ -44,15 +45,34 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water ...@@ -44,15 +45,34 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water
{ {
if (other.gameObject.layer == LayerMask.NameToLayer("MovableObject")) if (other.gameObject.layer == LayerMask.NameToLayer("MovableObject"))
{ {
if (Mathf.Abs(_rigidbody2D.velocity.x) > 0.0001f) if (Mathf.Abs(_rigidbody2D.velocity.x) > 0.0f)
{ {
var projectileVelocityX = _rigidbody2D.velocity.x / Mathf.Abs(_rigidbody2D.velocity.x); var velocity = _rigidbody2D.velocity;
print(projectileVelocityX); var projectileVelocityX = velocity.x / Mathf.Abs(velocity.x);
other.gameObject.GetComponent<Rigidbody2D>().velocity = new Vector3(projectileVelocityX * pushFactor, 0.0f, 0.0f); other.gameObject.GetComponent<Rigidbody2D>().velocity = new Vector3(projectileVelocityX * pushFactor, 0.0f, 0.0f);
Destroy();
} }
} }
Destroy(); else if (other.gameObject.layer == LayerMask.NameToLayer("Enemy"))
{
if (other.gameObject.CompareTag("Fire"))
{
other.gameObject.GetComponent<Life>().Damage(1);
}
if (Mathf.Abs(_rigidbody2D.velocity.x) > 0.0f)
{
var velocity = _rigidbody2D.velocity;
var projectileVelocityX = velocity.x / Mathf.Abs(velocity.x);
other.gameObject.GetComponent<Rigidbody2D>().AddForce(new Vector2(projectileVelocityX * pushEnemyFactor, 0.0f));
}
Destroy();
}
else if (other.gameObject.CompareTag("DestroyableByFire"))
{
Destroy();
}
} }
} }
......
...@@ -3,32 +3,36 @@ using System.Collections.Generic; ...@@ -3,32 +3,36 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using LevelauswahlScript; using LevelauswahlScript;
using PlayerSpawnPointScript; using PlayerSpawnPointScript;
using UnityEngine.UI;
public class SavePoint : MonoBehaviour public class SavePoint : MonoBehaviour
{ {
private bool isUsed; private bool isUsed;
private Transform options; private Transform options;
public Button button;
private void Start() private void Start()
{ {
button.interactable = false;
isUsed = false; isUsed = false;
options = gameObject.transform.Find("Options"); options = gameObject.transform.Find("Options");
} }
public void OnTriggerEnter2D(Collider2D other) public void OnTriggerEnter2D(Collider2D other)
{ {
options.gameObject.SetActive(true); //options.gameObject.SetActive(true);
} }
public void OnTriggerExit2D(Collider2D other) public void OnTriggerExit2D(Collider2D other)
{ {
options.gameObject.SetActive(false); //options.gameObject.SetActive(false);
} }
public void OnTriggerStay2D(Collider2D collision) public void OnTriggerStay2D(Collider2D collision)
{ {
if (Input.GetButtonDown("Interact")) if (Input.GetButtonDown("Interact"))
{ {
button.interactable = true;
isUsed = true; isUsed = true;
SaveSystem.SavePointUpdate(this); SaveSystem.SavePointUpdate(this);
} else if (Input.GetButtonDown("Teleport") && Levelauswahl.la.auswahlIsActive() == false) } else if (Input.GetButtonDown("Teleport") && Levelauswahl.la.auswahlIsActive() == false)
...@@ -44,6 +48,7 @@ public class SavePoint : MonoBehaviour ...@@ -44,6 +48,7 @@ public class SavePoint : MonoBehaviour
public void SetIsUsed(bool var) public void SetIsUsed(bool var)
{ {
button.interactable = var;
isUsed = var; isUsed = var;
} }
......
...@@ -15,7 +15,6 @@ public class MainMenu : MonoBehaviour ...@@ -15,7 +15,6 @@ public class MainMenu : MonoBehaviour
private Button _selectedBtn; private Button _selectedBtn;
private GameObject _old, _new; private GameObject _old, _new;
void Start() void Start()
{ {
......
...@@ -8,16 +8,16 @@ using LevelauswahlScript; ...@@ -8,16 +8,16 @@ using LevelauswahlScript;
public class PauseMenu : MonoBehaviour public class PauseMenu : MonoBehaviour
{ {
public GameObject pauseMenu, optionsMenu; public GameObject pauseMenu;
private EventSystem _myEventSystem; public EventSystem _myEventSystem;
public Button firstSelect; public Button firstSelect;
private GameObject _backScreen, _currentScreen;
private bool isPaused = false; private bool isPaused = false;
private GameObject _old, _new; private GameObject _old, _new;
public GameObject HUD;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
_myEventSystem = EventSystem.current;
} }
IEnumerator highlightBtn() IEnumerator highlightBtn()
...@@ -36,61 +36,39 @@ public class PauseMenu : MonoBehaviour ...@@ -36,61 +36,39 @@ public class PauseMenu : MonoBehaviour
{ {
_old = _new; _old = _new;
} }
if(Input.GetButtonDown ("Cancel") && isPaused == true && _backScreen == null) if(Input.GetButtonDown ("Cancel") && isPaused == true)
{ {
Resume(); Resume();
} else if (Input.GetButtonDown ("Cancel") && isPaused == false && _backScreen == null && Levelauswahl.la.auswahlIsActive() == false) } else if (Input.GetButtonDown ("Cancel") && isPaused == false && Levelauswahl.la.auswahlIsActive() == false)
{ {
Pause(); Pause();
} }
else if (Input.GetButtonDown ("Cancel") && isPaused == true && _backScreen != null) if (Input.GetMouseButtonDown(0))
{
_backScreen.SetActive(true);
_currentScreen.SetActive(false);