Fix health bar flip

This commit is contained in:
Yann Dupont 01 2022-04-03 00:58:11 -04:00
parent 48041ea26e
commit 3700cf800a
3 changed files with 148 additions and 120 deletions

View File

@ -48,6 +48,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c537e1bd61b8d5c42b1ec03f90e14855, type: 3} m_Script: {fileID: 11500000, guid: c537e1bd61b8d5c42b1ec03f90e14855, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
arena: {fileID: 0}
gameFlowManager: {fileID: 0} gameFlowManager: {fileID: 0}
<Health>k__BackingField: 40 <Health>k__BackingField: 40
healthBar: {fileID: 1378753993005748510} healthBar: {fileID: 1378753993005748510}
@ -343,11 +344,23 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3} - target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 0.4 value: 1.2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3} - target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 0.05 value: 0.15
objectReference: {fileID: 0}
- target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}

View File

@ -130,6 +130,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7e480b0ef5998894283e8091830941cb, type: 3} m_Script: {fileID: 11500000, guid: 7e480b0ef5998894283e8091830941cb, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
arena: {fileID: 0}
gameFlowManager: {fileID: 0} gameFlowManager: {fileID: 0}
<Health>k__BackingField: 40 <Health>k__BackingField: 40
healthBar: {fileID: 7668921808924868904} healthBar: {fileID: 7668921808924868904}
@ -353,11 +354,23 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3} - target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 0.4 value: 1.2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3} - target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 0.05 value: 0.15
objectReference: {fileID: 0}
- target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2962150095602046910, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: d1d8f8326b5490848a9400aa9bd6b2f4, type: 3}

View File

@ -2,9 +2,9 @@
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization; using UnityEngine.Serialization;
public class AIEntity : Entity public class AIEntity : Entity {
{ [FormerlySerializedAs("stats")]
[FormerlySerializedAs("stats")] [SerializeField] [SerializeField]
public AIStats AIStats = null!; public AIStats AIStats = null!;
BaseState currentState = null!; BaseState currentState = null!;
public EntityFlag enemies { get; protected set; } public EntityFlag enemies { get; protected set; }
@ -64,6 +64,8 @@ public class AIEntity : Entity
Vector3 scaler = transform.localScale; Vector3 scaler = transform.localScale;
scaler.x *= -1; scaler.x *= -1;
transform.localScale = scaler; transform.localScale = scaler;
healthBar.gameObject.transform.localScale = scaler;
} }
public void FlipAccordingToInput() { public void FlipAccordingToInput() {