Commit 16d68473 authored by Tommé Nöll's avatar Tommé Nöll
Browse files
parents 41bb5f5d 3f66ac0d
......@@ -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
......
......@@ -157,7 +157,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1467034929}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
......@@ -289,7 +289,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1467034929}
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}
......@@ -560,7 +560,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1467034929}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
......@@ -692,7 +692,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1467034929}
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}
......@@ -1052,12 +1052,12 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1467034929}
m_RootOrder: 6
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: 0, y: 140}
m_SizeDelta: {x: 368.2, y: 96}
m_SizeDelta: {x: 409.2, y: 187.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1429304041
MonoBehaviour:
......@@ -1079,7 +1079,7 @@ MonoBehaviour:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: a882eb030a82cea46bf1b03396c80c65, type: 3}
m_Sprite: {fileID: 21300000, guid: 0be1cf6c1aa98384da60cdf8a711ade9, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
......@@ -1205,12 +1205,12 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1375445807}
- {fileID: 1429304040}
- {fileID: 415816971}
- {fileID: 191938905}
- {fileID: 407276318}
- {fileID: 123865567}
- {fileID: 2047248187}
- {fileID: 1429304040}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -1348,7 +1348,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1467034929}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
......
......@@ -44,5 +44,6 @@ public class MushroomGrowth : MonoBehaviour
break;
}
}
}
......@@ -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);
}
}
}
}
......
......@@ -60,7 +60,7 @@ public class UI_Health : MonoBehaviour
IEnumerator WaitForDeath()
{
yield return new WaitForSeconds(1.5f);
yield return new WaitForSeconds(3f);
if (gameOverScreen != null)
{
gameOverScreen.ShowNow();
......
......@@ -38,7 +38,7 @@ public class UI_SceneManager : MonoBehaviour
}
void Start()
{
if (sp.GetScene() != SceneManager.GetActiveScene().buildIndex)
if (sp.GetScene() != SceneManager.GetActiveScene().buildIndex && SceneManager.GetActiveScene().buildIndex != 0 )
{
if (sp.targetsporn)
{
......@@ -62,11 +62,14 @@ public class UI_SceneManager : MonoBehaviour
{
if (!sp.loadGame)
{
sp.SetLife(3);
sp.SetScene(1);
sp.SetNumber(savepointo.gameObject.GetComponent<Resporn>().respornNo);
sp.SetPosition(savepointo.gameObject.GetComponent<Resporn>().GetPosition());
sp.pilzZustand = 0;
if (sp.GetNumber() == 1)
{
sp.SetLife(3);
sp.SetScene(1);
sp.SetNumber(savepointo.gameObject.GetComponent<Resporn>().respornNo);
sp.SetPosition(savepointo.gameObject.GetComponent<Resporn>().GetPosition());
sp.pilzZustand = 0;
}
}
}
......
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