Commit 3f66ac0d authored by Doemoetoer Kozak's avatar Doemoetoer Kozak
Browse files

Merge remote-tracking branch 'origin/ChrisMerge'

parents b7e08290 58339eaf
......@@ -90,7 +90,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 230
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
......
......@@ -339,49 +339,49 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: isJumping
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: isCrouching
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: isRoping
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: isGrounded
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: isPulling
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: isDamaged
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: isDeath
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
......@@ -711,6 +711,9 @@ AnimatorStateTransition:
- m_ConditionMode: 1
m_ConditionEvent: isDeath
m_EventTreshold: 0
- m_ConditionMode: 1
m_ConditionEvent: isDamaged
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1683217834139844393}
m_Solo: 0
......@@ -721,10 +724,10 @@ AnimatorStateTransition:
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 0
m_HasFixedDuration: 1
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
m_CanTransitionToSelf: 0
--- !u!1101 &6176847099265306089
AnimatorStateTransition:
m_ObjectHideFlags: 1
......@@ -847,6 +850,9 @@ AnimatorStateTransition:
- m_ConditionMode: 1
m_ConditionEvent: isDamaged
m_EventTreshold: 0
- m_ConditionMode: 2
m_ConditionEvent: isDeath
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -2082770153686990321}
m_Solo: 0
......
......@@ -47,12 +47,6 @@ public class Life : MonoBehaviour
life = value;
}
public void LoseLife()
{
life -= 1;
health.LifeLost(life);
}
private void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.layer == hazardLayer || other.gameObject.layer == enemyLayer)
......@@ -63,11 +57,19 @@ public class Life : MonoBehaviour
animator.SetBool("isDamaged", true);
life--;
health.LifeLost(life);
//die Kraft der beiden Objekte für die richtung des Knockbacks
knockback = other.transform.position - playerRigidbody.transform.position;
knockback.y = knockback.y + 100;
playerRigidbody.AddForce(knockback.normalized * -500f);
StartCoroutine(Invincebil());
if (life > 0)
{
//die Kraft der beiden Objekte für die richtung des Knockbacks
knockback = other.transform.position - playerRigidbody.transform.position;
playerRigidbody.AddForce(knockback.normalized * -250f);
StartCoroutine(Invincebil());
}
else
{
animator.SetBool("isDeath", true);
}
}
}
}
......
m_EditorVersion: 2019.1.9f1
m_EditorVersionWithRevision: 2019.1.9f1 (d5f1b37da199)
m_EditorVersion: 2019.1.0f2
m_EditorVersionWithRevision: 2019.1.0f2 (292b93d75a2c)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment